You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
enable a customizable sound to indicate successful/failed task completion #12466
It is very needed when the typescript compiler is working in a watch mode.
So after a code change I could immediately switch to a browser. If there were no errors I will just refresh a page to see the changes. So I don't have to visually monitor the status bar of VSCode.
fantaclaus there is feedback if the tsc compiler is in watch mode. There should be a spinning ascii art next to the problem indicator in the status bat when the tsc compile is active in the background.
Really simple implementation. Allow items in the status bar to change their background color. Preferably just provide a method to set the css on that element so you can do css animations.
Blinking red: failure
Green: success.
would be easy to return them to their original state as well
However, this is pretty hacky. It ships with an .exe for windows users that is uses child_process.execFile(...) to run that .exe (passes audio file path via cli argument) for other systems, it uses [shime/play-sound]which attempts to find a native media player to send the sound to (useschild_process.execFile(...)` aswell)
But this terribly inefficient because it spawns a seperate process each time you trigger the sound. Plus you can't pause, seek, restart, etc. Hell there's not even a good way of telling if the sound is finished playing. Not to mention compatibility issues.
It'd be cool to offer a easy way to do this. Would prob be easy considering vscode use electron which is basically a browser, which means it'll have access to the Web Audio Api so you just need to write a shim that interacts with it.
[Click to Expand] I got inspired and wrote a simple api that vscode could implement
import{Sound}from'vscode';consterrorSound=newSound(someURI);// create a new sounderrorSound.length();// number; eg: 5000 (ms)errorSound.play();// plays the from the current cursor position; if cursor is at the end of// the track move it back to the start and begin playing there// returns promise that resolves when the track has finishederrorSound.play(start: number);// plays the track from the specified start position until end of track.// returns promise that resolves when the track has finishederrorSound.play(start: number,end: number);// plays the track from the start position until the the end position.// returns promise that resolves when the track has finishederrorSound.cursorPosition;// number; the current (ms) position of the 'cursor' in the track.errorSound.seek(time: number);// move 'cursor' to specified time. If playing, continue // to play, otherwise remain stopped.errorSound.pause();// stop at current positionerrorSound.restart();// move 'cursor' to 0, and keep/start playing.// returns promise that resolves when the track has finishederrorSound.isPlaying();// boolean, if the sound is playingerrorSound.donePlaying();// boolean; true if the cursor is at the end of the trackerrorSound.stop();// stops playing the sound, cursor returns to 0errorSound.loop(times?: number);// plays the sound specified number of times. // Omitting a number makes it loop infinitely until stopped // or restarted, but pause/resume don't stop it from looping// returns a promise that is resolved when looping is completed or stoppederrorSound.loopsLeft;// false if not looping, undefined if looping infinitely or when looping for x ms.// otherwise gives the number of remaining loops (excluding// the current play through. So if you read this value while the loop// is in its last iteration, it returns 0. Or if you specify 10 loops,// on the first iteration this method would tell you 9 left.errorSound.loopFor(ms: number);// same behavior but dependant on elapsed ms instead of iterations.// pausing the track also pauses the elapsed timer until playing is resumed// probably should add an equivalent for loops remains. perhaps "loopTimeLeft"// returns a promise that resolves when the loop has finished.errorSound.dispose();// destroy that object. If there are no other instances of the same file, unload the audiobuffer/whateverconsterrorSound2=errorSound.clone();// creates clone of the sound so that 2+ instances of the same sound// can be controlled independently. Maintain their own cursor // position, playing status, loopsLeft, etcSound.loaded// an array of each instance, but cloned duplicates are dedupedSound.all// an array of all the instances (including clones/duplicates)Sound.playing// an array of the instances that are currently playing.
...but then I realized that there are prob better preexisting libs out there built on top of the WebAudioApi with simple api.
But currently I have to watch it and wait until it stop spinning.
I would rather prefer to use this time to review the code or to switch to a browser and be ready to reload a page as soon as I hear the sound of success.
Moreover, at some workplaces I have only one monitor, and a browser takes its surface entirely. So I cannot see VSCode at the same time.
Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.
Alex Ross (@alexr00), how could the request for "customizable sound" be a duplicate for a request for "some visual feedback"? The sound is not a kind of visual effect, is it?
Activity
chrmarti commentedon Sep 22, 2016
Or a visual notification could be helpful too.
dbaeumer commentedon Sep 22, 2016
There is an issue requesting a proper status bar item for tasks.
fantaclaus commentedon Sep 23, 2016
I'm also waiting for this feature.
It is very needed when the typescript compiler is working in a watch mode.
So after a code change I could immediately switch to a browser. If there were no errors I will just refresh a page to see the changes. So I don't have to visually monitor the status bar of VSCode.
dbaeumer commentedon Sep 26, 2016
fantaclaus there is feedback if the tsc compiler is in watch mode. There should be a spinning ascii art next to the problem indicator in the status bat when the tsc compile is active in the background.
rozzzly commentedon Sep 26, 2016
Really simple implementation. Allow items in the status bar to change their background color. Preferably just provide a method to set the css on that element so you can do css animations.
Blinking red: failure
Green: success.
would be easy to return them to their original state as well
I'd like to point out that it is possible to play sounds from the extension api. [
timmyreilly/TypewriterNoises-VSCode]However, this is pretty hacky. It ships with an
.exefor windows users that is useschild_process.execFile(...)to run that.exe(passes audio file path via cli argument) for other systems, it uses [shime/play-sound]which attempts to find a native media player to send the sound to (useschild_process.execFile(...)` aswell)But this terribly inefficient because it spawns a seperate process each time you trigger the sound. Plus you can't pause, seek, restart, etc. Hell there's not even a good way of telling if the sound is finished playing. Not to mention compatibility issues.
It'd be cool to offer a easy way to do this. Would prob be easy considering
vscodeuseelectronwhich is basically a browser, which means it'll have access to the Web Audio Api so you just need to write a shim that interacts with it.[Click to Expand] I got inspired and wrote a simple api that vscode could implement
...but then I realized that there are prob better preexisting libs out there built on top of the WebAudioApi with simple api.
oh well 😒
fantaclaus commentedon Sep 26, 2016
Dirk Bäumer (@dbaeumer) you are right, there is a spinning indicator.
But currently I have to watch it and wait until it stop spinning.
I would rather prefer to use this time to review the code or to switch to a browser and be ready to reload a page as soon as I hear the sound of success.
Moreover, at some workplaces I have only one monitor, and a browser takes its surface entirely. So I cannot see VSCode at the same time.
ronjb04 commentedon Oct 26, 2018
any solution for this yet? i was hoping that vscode already has this sound feature when task is done
alexr00 commentedon Oct 16, 2019
Duplicate of #7090
vscodebot commentedon Oct 16, 2019
Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.
Happy Coding!
fantaclaus commentedon Oct 16, 2019
Alex Ross (@alexr00), how could the request for "customizable sound" be a duplicate for a request for "some visual feedback"? The sound is not a kind of visual effect, is it?
alexr00 commentedon Oct 17, 2019
The duplicate is about adding a post action to tasks. Visual feedback or a sound after a task are both types of post action.