play an OGG stream

BlitzMax Forums/BlitzMax Programming/play an OGG stream

MagicalTux(Posted 2006) [#1]
Well...

I've been trying to get BlitzMax to play an OGG stream (streamed by http), however I get a "stream is not seekable" error.

Wouldn't it be possible to play an ogg stream using BlitzMax's modules directly ? The idea would be to be able to distribute a blitzmax-based player since many people were complaining to me about the fact most players can't play ogg streams.

For reference, my piece of test-code :
Local socket:TSocket = CreateTCPSocket()
If Not ConnectSocket(socket, HostIp("stream.ookoo.org"), 80) Then End
Local stream:TStream = CreateSocketStream(socket)
WriteLine(stream, "GET /radio.ogg HTTP/1.0")
WriteLine(stream, "Host: stream.ookoo.org")
WriteLine(stream, "")
Local res$="x"
While res<>""
	res=ReadLine(stream)
	DebugLog(res)
Wend
Local sound:TSound = LoadSound(stream)
PlaySound(sound)



TartanTangerine (was Indiepath)(Posted 2006) [#2]
And ogg file is encoded, you need more information that just the *current* data to decode it.


Grisu(Posted 2006) [#3]
You can stream it via fmod e.g.. Works like charm.


popcade(Posted 2006) [#4]
As Mark said there'll be no advanced sound support for BMax, your only way is to use 3rd party libs, with this you can also avoid threading prob in BMax as BMax can't handle threading (yet).


Chris C(Posted 2006) [#5]
hmm thats a major shame, where did Mark say that? as is the max sound system is rather under powered, I always assumed that the basic sound support would be improved as time went on.


popcade(Posted 2006) [#6]
Take a look here:
http://www.blitzbasic.com/Community/posts.php?topic=61063

That means the sound support won't go further, fmod is not that bad, but rather disappointing.

I tend to make a Win32 only game so I may choose audiere, just trying to convert the code from PB.
(I suspect output sound stream with DSound should be OK, however not 100% sure about this, freeaudio is somehow buggy)