node-sonos-http-api
node-sonos-http-api copied to clipboard
Feature request MediaRenderer/AVTransport/Control
Looking for a way to mimic an Apple app called Sonos Intercom. It allows you to broadcast your voice in realtime over sonos speakers. I did a little work and captures how it talks to the Sonos units. It uses api call MediaRenderer/AVTransport/Control When the app starts it send a post with the following envelope. <s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/' s:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'> <s:Body> <u:SetAVTransportURI xmlns:u='urn:schemas-upnp-org:service:AVTransport:1'> <CurrentURI> http://192.168.1.129:8080/SonosIntercom.wav </CurrentURI> <InstanceID> 0 </InstanceID> <CurrentURIMetaData> </CurrentURIMetaData> </u:SetAVTransportURI> </s:Body> </s:Envelope>
This looks like it sets the sonos to load this wav file. Then the app send another api command when the end user hits the hold to talk button to play. Very simple the app creates the wav file in realtime and the sonos then streams it.
I cannot find any options in this code that would support this type of feature. I tried the clip options but it will not play the file while its open or recording. I get this error: FourCC contains invalid characters. I think this is because it a file and not being streamed via http but not sure I am very new to this.
Attached is copy of wireshark recording.
Any help on this would be appreciated.
I would also love this!
There are other ways:
- TTS where you type in text and the text is spoken over the Sonos speakers
- Record your voice and then AirPlay the voice file to the speakers
I use TTS a lot.
Yeah I need to look into tts. And I hadn’t thought about airplaying a file after recording it, I might play around with that too! Thanks.