I have a permanent IceCast http stream (mp3 192 kbs) on my local network that I can listen to via, for example, VLC for Linux or on my Android phone. I was hoping to be able to listen to it from within AROS using the httpstreamer and avcodec plugins. I also tried this on Amiga OS39 with same result. The url$ in the following code is how you listen to the IceCast stream from within VLC. The following code says OpenMusic can't find radio.mp3 so its probably looking for a file by that name at the url rather than a stream. Is it possible to listen to the stream this way or am I doing something wrong in the code? Thanks.
NathanH
Code: Select all
@REQUIRE "avcodec"
@REQUIRE "httpstreamer", {UserAgent="Firefox", Timeout=20000}
Function p_Die(msg$)
DebugPrint("ERROR: " .. msg$)
End()
EndFunction
Function p_Main()
Local url$ = "http://192.168.0.29:8000/radio.mp3"
Local mus
; If HTTPStreamer+AVCodec are working, OpenMusic() should accept the URL.
mus = OpenMusic(Nil, url$, {Loader="httpstreamer", "Adapter="avcodec"})
If IsNil(mus)
p_Die("OpenMusic() failed for: " .. url$)
EndIf
PlayMusic(mus)
; keep running so it can continue streaming
Repeat
WaitLeftMouse() ; click to stop (simple demo)
Until False
StopMusic(mus)
CloseMusic(mus)
EndFunction
p_Main()