-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Spoken message appears as a short gap of silence if streaming/playing #73
Comments
The code for the notifications is here. How short is the notification? |
Thanks. The notification is a full sentence.
EDIT: I've installed it locally and I've figured out how to debug it. Below is the debug output.
I don't know if it's helpful or not. I've set I can add more debug messages in Thank you for your kind help Stephan! Cheers! |
If I add a wait statement after the TTS volume is set, things start to work. Maybe things are coming in to fast for Sonos. In
Maybe it would be a good idea to add a small delay after every command that is succeeded by another one. What do you think? Shall i make a PR for you? |
Who had ever thought that I could make it too fast.... 😁 Does that also mean that it just works if the volume isn't supplied with the PlayTTS command? That means the volume won’t get overriden, = less commands. Yes please, the more contributors the better. Ever done development on a TypeScript library? Can you create the async Also the delay is probably only needed after the volume change, or maybe after commands that change stuff. Never had problem with the commands retrieving data. This is the only method that does several commands really short after each other. |
I'll do that tomorrow. Later, we could consider making the |
Actually, no it doesn't. After testing, I've found out that we do need a delay between this.AVTransportService.SetAVTransportURI and this.AVTransportService.Play.
No I haven't. I will just improvise, try it out here and trust that any mistakes will be spotted in the PR.
That won't help because the AsyncHelper isn't used when setting the Volume. Maybe it should be used. However that's above my experience level.
Yeah, I agree. I make that PR now so that we can discuss the specific code by reviewing the suggested code. It's easier than doing it here. Please feel free to suggest any type of changes in the PR. Cheers! |
That should build (actually transpile) the typescript to javascript, and run the current open sample. The code in the repository is only TypeScript and the lib-folder is automatically ignored.
I mean that it might be better to put the delay function in the AsyncHelper class. That code might be needed in other places in the library. Something like static async Delay(milliseconds: number): Promise {
return await new Promise(resolve => setTimeout(resolve, 500));
} Then you can use it by calling: await AsyncHelper.Delay(150); Closing this issue, moving to svrooij/node-sonos-ts#38 |
Version 2.0.12 has a fix for this. It allows for setting a delayMs in TTS or notification that should solve the issue. Also the reverting doesn’t try to revert the track for streaming items. That should also make up for some of the errors. |
On v2.0.11
When playing an Album or when playing a Spotify playlist on the Sonos, most times the spoken message fails and is replaced with a very short period of silence. (Timing issue?) (In my Sonos app I can see the message clip file name showing up briefly) Sometimes, randomly the message gets spoken correctly. When that happens resuming the streamin/playing wont happen. Furthermore volume level is not restored to the level that was actual when streaming/playing.
FWIW I don't know anything why this happens but it sounds like a series of commands are sent to Sonos asynchronously. Maybe Sonos can not handle that. Sonos might not have a command queue and as a result discards previous commands when a new comes in. Just a thought.
The text was updated successfully, but these errors were encountered: