I created a little app that when you pass it a url to a shoutcast stream it starts to stream the data recived to a file (stream.mp3), I have just come accross FMOD and would like to play the stream while its being downlaoded is this possible seens as a shoutcast stream is realy just one huge mp3 file?.
Whoever comes up with a good example gets the sopurce code as an incentive ;o)
- Anonymous asked 16 years ago
I think the right way is to play the received buffer from FSOUND_Stream_OpenFile and not your buffer.
vo_PFSoundStream:= FSOUND_Stream_OpenFile(PChar(vs_FileName), FSOUND_NORMAL, 0);
FSOUND_Stream_SetEndCallback(vo_PFSoundStream, BCallBackFinChanson , 0);
if vo_PFSoundStream<>nil then
vi_Channel:= FSOUND_Stream_Play(FSOUND_FREE, vo_PFSoundStream);
with vo_PFSoundStream: PFSoundStream;
You can play the song this way passing a filename but i don’t know if you can play a MemoryStream directly…
- mikaelmorvan answered 16 years ago
Ok I have created a MemoryStream and writing the data recived to it and then using
function PlayFromMemory(Stream: TMemoryStream): PFSoundStream;
FSOUND_Init(44100, 16, 0);
FSOUND_Stream_OpenFile(Stream.Memory, FSOUND_LOADMEMORY, Tempstream.Size);
to try and play the data but it just throws up and exception.
Please login first to submit.