Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable a customizable sound to indicate successful/failed task completion #12466

Closed
zpdDG4gta8XKpMCd opened this issue Sep 22, 2016 · 11 comments
Closed
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality tasks Task system issues
Milestone

Comments

@zpdDG4gta8XKpMCd
Copy link

  • VSCode Version: 1.5.2
  • OS Version: Windows 10

It would be helpful to hear a sound at completion long running tasks.

@chrmarti
Copy link
Collaborator

Or a visual notification could be helpful too.

@chrmarti chrmarti added the feature-request Request for new features or functionality label Sep 22, 2016
@dbaeumer dbaeumer added the tasks Task system issues label Sep 22, 2016
@dbaeumer
Copy link
Member

There is an issue requesting a proper status bar item for tasks.

@fantaclaus
Copy link

fantaclaus commented 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
Copy link
Member

@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
Copy link

rozzzly commented 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 .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';

const errorSound = new Sound(someURI);
// create a new sound
errorSound.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 finished
errorSound.play(start: number); 
// plays the track from the specified start position until end of track.
// returns promise that resolves when the track has finished
errorSound.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 finished
errorSound.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 position
errorSound.restart(); 
// move 'cursor' to 0, and keep/start playing.
// returns promise that resolves when the track has finished
errorSound.isPlaying();
// boolean, if the sound is playing
errorSound.donePlaying(); 
// boolean; true if the cursor is at the end of the track
errorSound.stop();
// stops playing the sound, cursor returns to 0
errorSound.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 stopped
errorSound.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/whatever
const errorSound2 = 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, etc
Sound.loaded // an array of each instance, but cloned duplicates are deduped
Sound.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.

oh well 😒

@fantaclaus
Copy link

@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.

@dbaeumer dbaeumer added this to the Backlog milestone Nov 10, 2017
@ronjb04
Copy link

ronjb04 commented Oct 26, 2018

any solution for this yet? i was hoping that vscode already has this sound feature when task is done

@alexr00 alexr00 assigned alexr00 and unassigned dbaeumer Oct 7, 2019
@alexr00
Copy link
Member

alexr00 commented Oct 16, 2019

Duplicate of #7090

@alexr00 alexr00 marked this as a duplicate of #7090 Oct 16, 2019
@alexr00 alexr00 added the *duplicate Issue identified as a duplicate of another issue(s) label Oct 16, 2019
@vscodebot
Copy link

vscodebot bot commented 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!

@vscodebot vscodebot bot closed this as completed Oct 16, 2019
@fantaclaus
Copy link

@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
Copy link
Member

alexr00 commented 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.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality tasks Task system issues
Projects
None yet
Development

No branches or pull requests

7 participants