0
0

I have two PCM buffers one for the left channel and one for the right channel.
I think fmod only handles interleaved data in a streamcallback so i try to make a interleaved PCM buffer of the left and the rightbuffer:
[code:16ky3u28]
signed char F_CALLBACKAPI FSOUNDStream::FLACStreamCall(FSOUND_STREAM *stream, void *buff,
int len, void *userdata)
{
signed short *stereo16bitbuffer = (signed short *)buff;
FLAC__FileDecoder *MyFlac = (FLAC__FileDecoder *)userdata;
if (!FLAC__file_decoder_process_single(MyFlac)) {
return false;
}
for (int count=0; count<(len/4);)
{
if (count < FLACBufferSize ) {
stereo16bitbuffer[count] = FLACLeftBuffer[count];
count++;
stereo16bitbuffer[count] = FLACRightBuffer[count];
count++;
} else {
stereo16bitbuffer[count];
count++;
stereo16bitbuffer[count];
}
}
delete []FLACLeftBuffer;
delete []FLACRightBuffer;
return true;

}
[/code:16ky3u28]
but i get a skipping sound from my left speaker and my right speaker doesn’t play anything. I create the stream with FSOUND_NORMAL | FSOUND_16BITS | FSOUND_STEREO. I am probably doing something very wrong but i don’t know what :(

thanks in advance

chris

edit: FLACBuffersize is the number of stereo samples of the two buffers together.

  • You must to post comments
0
0

thanks i modified my code and i can play FLAC files now 😀 :

  • You must to post comments
0
0

Chris,

Could you please post the code.

I’m coding in delphi 6, but the source could help a lot.

I’m planning to add cue sheets, replaygain and flac support.

thanks in advance.

  • You must to post comments
0
0

[quote="wolfpack":135503eu]Chris,

Could you please post the code.

I’m coding in delphi 6, but the source could help a lot.

I’m planning to add cue sheets, replaygain and flac support.

thanks in advance.[/quote:135503eu]

I only added Monkey’s Audio and FLAC support till now. I’ve uploaded the zip again (i fixed some things and added some extra functions). You can download it from the topic KarLKoX linked to. It shouldn’t be too hard to port to delphi. But you will have to convert some header files to delphi (libFlac and MACDll). :( mail me if you need any help (christanaskoski@hotmail.com)

  • You must to post comments
0
0

Ok, thanks Chris and and KarLKox.

I’ll be checking it out.

  • You must to post comments
0
0

wolfpack, any progress with the replaygain support?

  • You must to post comments
Showing 6 results
Your Answer

Please first to submit.