0
0

Hi All,

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)

Regards,
Christian Piper

  • You must to post comments
0
0

This is in Delphi 5 btw.

Regards,
christian Piper

  • You must to post comments
0
0

Ok I have created a MemoryStream and writing the data recived to it and then using

function PlayFromMemory(Stream: TMemoryStream): PFSoundStream;
begin
FSOUND_Init(44100, 16, 0);
FSOUND_Stream_OpenFile(Stream.Memory, FSOUND_LOADMEMORY, Tempstream.Size);
FSOUND_Stream_Play(0, Stream);
end;

to try and play the data but it just throws up and exception.

Any ideas?

  • You must to post comments
0
0

Hi,

I think the right way is to play the received buffer from FSOUND_Stream_OpenFile and not your buffer.
It mean:
[code:11qkkbjx]
vo_PFSoundStream:= nil;
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);
[/code:11qkkbjx]
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…

See you

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.