node-sonos-http-api icon indicating copy to clipboard operation
node-sonos-http-api copied to clipboard

Feature request MediaRenderer/AVTransport/Control

Open jbittner1002 opened this issue 3 years ago • 3 comments

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.

packet-dump.zip

Any help on this would be appreciated.

jbittner1002 avatar May 01 '21 22:05 jbittner1002

I would also love this!

jasonthefirs avatar Dec 20 '21 23:12 jasonthefirs

There are other ways:

  1. TTS where you type in text and the text is spoken over the Sonos speakers
  2. Record your voice and then AirPlay the voice file to the speakers

I use TTS a lot.

jsiegenthaler avatar Dec 21 '21 09:12 jsiegenthaler

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.

jasonthefirs avatar Dec 21 '21 13:12 jasonthefirs