Play a streaming on browser

Hi all,
I created a rule that executes a script when an item switches to ON.
In the script, I added a log entry, then playStream(“webaudio”, “http://streams.fluxfm.de/60er/mp3-128/streams.fluxfm.de/play.m3u”), and then another log entry.
I see both log entries, but I can’t hear the audio.
I also started the HABPanel viewer and added the start button, but I still can’t hear anything.
Do I need to add a widget to listen to the audio in the browser (and maybe in the app)?
Thanks

I don’t know about HABPAnel or HABPanel viewer. I didn’t think HABPanel could register as an audio sink but I could be wrong about that.

In MainUI you go to Help & About and there is a toggle at the bottom to “Enable Web Audio sink support” which is off by default. You need to toggle that on in order for that client to become registered as an audio sink that OH can send audio to.

Hi @rlkoshak.
Thanks for reply.
I have enable “Web Audio”, in the setup


And I have enable web audio sink

But if I enable one switch that execute a script, doesn’t works.

So are you using HABPanel or MainUI?

That means you have enabled that one browser running MainUI to be an audio sink. If HABPanel supports being an audio sink, there will be a setting somewhere inside of its settings.

You need to tap on the browser first after you have loaded MainUI to get the sound played.
This is required every time you restart the browser.

I enabled the “Enable support for web audio sink” option in the browser using the Main UI. When I run the rule, I get this log (I enabled debug), but I can’t hear anything.

I have try with another audio streaming mp3 (http://ice1.somafm.com/groovesalad-128-mp3) but doesn’t works.

14:38:30.649 [DEBUG] [o.internal.webaudio.WebAudioAudioSink] - Received audio stream of format AudioFormat [codec=MP3, container=NONE, bigEndian=false, bitDepth=16, channels=1]
14:38:30.651 [DEBUG] [nhab.core.audio.internal.AudioServlet] - timeout 10 seconds => timestamp 9840130509901362 nanoseconds
14:38:30.652 [INFO ] [openhab.event.PlayURLEvent           ] - Play URL '/audio/0f6ea4f2-d6ad-413d-b5f3-21fe7659f956'.
14:38:30.698 [DEBUG] [nhab.core.audio.internal.AudioServlet] - Stream to serve is /audio/0f6ea4f2-d6ad-413d-b5f3-21fe7659f956