u/Cenoks1

▲ 3 r/bose

Working examples of XML and JSON for the SoundTouch?

Do people have any working examples of how to set a preset button on the SoundTouch using XML, so that when that button is pressed the SoundTouch reads a JSON file from a local NAS, and streams a radio station? I just want the app to program the buttons so the radio will work by itself. Here's what I've tried... I think the problem is in the JSON file...

Use three Powershell commands to configure a button (192.168.2.13 is my SoundTouch, 192.168.2.34 is my local web server):

$url = "http://192.168.2.13:8090/storePreset"

$xml = '<preset id="1"><ContentItem source="LOCAL_INTERNET_RADIO" type="stationurl" location="https://192.168.2.34/cbc.json" sourceAccount="" isPresetable="true"><itemName>CBC</itemName></ContentItem></preset>'

Invoke-WebRequest -Uri $url -Method Post -Body $xml -ContentType "application/xml"

After this command I get a status OK response so at least that did program button 1.

The JSON file stored on the server is simple:

{

"name": "CBC",

"streamType": "liveRadio"

"streamUrl": "https://playerservices.streamtheworld.com/api/livestream-redirect/CBLAFM_CBC.mp3"

"isRealtime": "true"

}

When I push button 1 it shows CBC but nothing is streaming, just silence. After a moment it goes back and shows AUX. I tried http for the streamUrl and that didn't work either. Since I didn't get Service Unavailable, I think the SoundTouch was happy with the button setting but it's the JSON file that's not right?? Or perhaps I need a radio station URL that is known to work this way and the CBC value is wrong...

reddit.com
u/Cenoks1 — 17 hours ago