-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add sound to timer when it alerts #2378
base: main
Are you sure you want to change the base?
Conversation
Comparing the old code to the new code, this looks like it just takes the check to see if the alert should be set, and stores that in a variable that is then used to 1) trigger audio, and 2) sets the alert (as usual). The only feedback I have is that there looks like there is extra space before Also, if #2377 is merged first (as is), then |
Why do you link to the web instead of including the sound file as an asset? In theory, it probably makes more sense to trigger playing the audio in I don't want to work on this though so if you don't want to refactor this, it can just stay the way it is. It's just a few bytes... |
Fixed.
It's not that I don't want to get it right, but I don't understand what you are suggesting. I'll leave it here in case @bjalder26 can figure it out. Otherwise, I'll probably merge in a couple of days. |
In Give it a try but it's no big deal if we use the current version. |
That worked and makes sense now that you explain it. Except I couldn't use await because it isn't async. Or that's what VSC told me. |
That's fine but then please append |
Is this the type of thing you're looking for? fetch(this.get('alertSound'))
.then(response => {
if (!response.ok) {
throw new Error('Failed to fetch alertSound');
}
return response;
})
.then(response => addAudio(this.get('alertSound'), 1, 0, 1))
.catch(error => {
console.error('AlertSound error:', error);
}); |
Fixes #1333 if this and #2377 are merged.
Adds a property to timers
alertSound
that links to a URL and is played if the timer alert is triggered.The tutorial is updated to relfect the change.
PR-SERVER-BOT: You can play around with it here: https://test.virtualtabletop.io/PR-2378/pr-test (or any other room on that server)