Closed thosirl closed 8 years ago
The only problem i have is that if ANY error occurs while playing TTS, it wont resume.
TTS doesnt seem to want to resume of my ZPs or Play1's now either. Anything I'm missing here? Local playlist or tracks, not trying any services.
No, there is something very wrong with it. I'm gonna look at it soon, will also implement support for voicerss registered service which will have more natural sound.
Great, will keep a watch
Thumbs up! Pretty excited about resolution of this ticket
Does it resume in your environment with any SONOS player? It does not in my case nor does it set the volume before talking. My wife is currently close to a heart attack as TV needs high volume and TTS rather low :-)
I'm thinking about the following logic on the client side:
Otherwise can result in awkward situations indeed :)
Agree but today it does not seem to work. I played around a bit with the code but could not make it happen, yet
Sent from Ninehttp://www.9folders.com/
Von: Armen Mkrtchyan notifications@github.com Gesendet: 07.01.2016 8:28 nachm. An: jishi/node-sonos-http-api Cc: Roger Halbheer Betreff: Re: [node-sonos-http-api] TTS doesn't resume TV on Playbar (#61)
I'm thinking about the following logic on the client side:
Otherwise can result in awkward situations indeed :)
Reply to this email directly or view it on GitHubhttps://github.com/jishi/node-sonos-http-api/issues/61#issuecomment-169781686.
First, a big Thank You for undertaking this task. Can't believe Sonos hasn't done this themselves... they really should buy your work, work through a few of the problems, and release it as an officially supported API.
As with several other commenters who have home automation systems, my primary goal for your API is to endow my home automation system with the ability to speak status events in various rooms around the house. I plan to eventually use rgraciano's Echo-Sonos integration to allow Echo to control Sonos, but for now the primary goal is home automation TTS.
I've read through several issues related to Say and SayAll, and what I'm seeing seems similar, but I'm not sure if this exact scenario has been posted yet. I'm only using Say, since my application doesn't need/want to broadcast into the entire house.
I'm seeing that if I use Say on a single Sonos Connect:Amp (i.e. it's not grouped with any other rooms), the Say command generally works (although sometimes you don't hear part or any of the spoken text, even when it's using a cached file... seems to be a timing issue), but it never restores the room to the song that was playing before Say interrupted it. If I DO have the room grouped with another one, it appears to correctly restore the player to what it was doing prior to the Say (although the group doesn't seem to be re-formed).
I don't understand much of your code yet, but it appears the problem may be that groupToRejoin is being defined even if there is no group to rejoin. When I have just the one room (i.e. not in a group) the preset.uri value is coming back as x-rincon:undefined after it's assigned to getGroupCoordinatorByID(player.discovery.zones, groupToRejoin) in the transportStateClosure function.
Since I don't understand enough of your code yet, I made a really ugly hack that seems to work, but I'm sure it's NOT the right way to fix this :-) I'm pasting in my version of transportStateClosure that includes the ugly hack. I put comments on each new line so you could see the changes easily.
I'm thinking this may also be the root cause of a few other commenters reporting that their Sonos room never resumes after a Say command.
function transportStateClosure(player, backupPresets) {
var oldUri; // WHM 2016-01-19
var hasStartedPlaying = false;
return function listener(state) {
if (player.state.currentState == "PLAYING") {
hasStartedPlaying = true;
return;
}
if (hasStartedPlaying && player.state.currentState == "STOPPED") {
var asyncSeries = [];
backupPresets.forEach(function (backupPreset) {
asyncSeries.push(function (preset) {
return function (callback) {
if (groupToRejoin) {
// player was broken out, need to rejoin right coordinator
oldUri = preset.uri; // WHM 2016-01-19
preset.uri = 'x-rincon:' + getGroupCoordinatorByID(player.discovery.zones, groupToRejoin);
if (preset.uri.indexOf('undefined')) { // WHM 2016-01-19
preset.uri = oldUri; // WHM 2016-01-19
} // WHM 2016-01-19
}
player.discovery.applyPreset(preset, function (error, result) {
callback(error, result);
});
};
}(backupPreset));
});
async.series(asyncSeries, function (err, result) {
if (err)
console.error('error in async series when applying backup', err, result)
})
player.removeListener('transport-state', listener);
}
}
}
I have made some changes to fix the restoring, but I don't have a PLAYBAR. Could anyone who owns one check to see if it works as intended now? Remember to register for a voicerss api key and add that to settings.json. Check the README for more info.
Hi Jimmy,
Will your change break my use of cached voice files that I already have in place from when the google solution was working? It’s really important for me that those files can continue to be used. I have about 200 standard phrases that are in use by my automation system and I don’t want to have to recreate them as it took a long time to get the pronunciation just rightJ. As they are cached it doesn’t bother me that the google system isn’t working any more.
Thanks
Peter.
From: Jimmy Shimizu [mailto:notifications@github.com] Sent: Monday, February 01, 2016 10:05 To: jishi/node-sonos-http-api Subject: Re: [node-sonos-http-api] TTS doesn't resume TV on Playbar (#61)
I have made some changes to fix the restoring, but I don't have a PLAYBAR. Could anyone who owns one check to see if it works as intended now? Remember to register for a voicerss api key and add that to settings.json. Check the README for more info.
— Reply to this email directly or view it on GitHub https://github.com/jishi/node-sonos-http-api/issues/61#issuecomment-177864421 . https://github.com/notifications/beacon/AKyrHNxPu4a_hAg6nLXv2MVLdWmJsVVFks5pfxdNgaJpZM4FXDSF.gif
@ppitkin Hm, I assume that if you don't change your tts urls, it will still use the same files. I suggest you make a backup of them, though, just to be safe. It shouldn't overwrite files, but in the case of a failed request, it is supposed to delete the empty file that it might have created.
If you change the language code to the new xx-xx format, it will try to find new files, but if you keep your two-letter language code, it should continue working because I use the same hashing format as before.
Hi, When using TTS 'say' with Playbar while watching/listening to TV it fails to resume afterwards, and needs to be manually set back to TV.
Thanks, Tom