0
0

I am trying to convert a mono stream into a stereo stream in order to manipulate it within a callback.

Please could you provide me with an example or some assistance?

I have noted that a suggestion has been made that requires a new stream to be created (FSOUND_StreamCreate), but not sure how to achieve this.

I have tried opening the original stream and then passing this as a parameter into the callback for the created stream, taking some guidance from the userstream example.

[code:2coft94r]stream2 = FSOUND_Stream_Open(...);
stream = FSOUND_Stream_Create(callback, ..., (void *)stream2);[/code:2coft94r]
with the callback manipulating the output buffer using the input from stream2,

but this only seems to work on the very first sample.

The mono source may come from a file of type .wav, .ogg, or .mp3.

Would this need to be done in conjunction with a DSP_Callback on the stream?

Or is there an easier way to do it (like FORCE_STEREO that works before the MIXER stage)

Thanks for any help.[code:2coft94r][/code:2coft94r]

  • You must to post comments
0
0

The only way you could feasibly do it is to use a DSP callback. You wont be able to do it with stream callbacks.

  • You must to post comments
0
0

How could I do this?

As far as I understand it the output buffer from the DSP callback will be the same size as the input buffer.

If the input buffer is mono, and I want the output buffer to be stereo I will need to double the length of data output.

Would you be able to give an example of how to do this?

Many thanks.

  • You must to post comments
0
0

no, in a DSP callback it is always stereo, that was the reason i said it is about the only way. You can’t convert from mono to stereo anywhere yourself with fmod. (unless you read the data yourself into a custom stereo stream, but then you’re missing out on fmod’s codec support)

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.