Advertisement

[Solved] Mono to stereo PCM

Started by August 30, 2011 05:15 PM
2 comments, last by projectghost 13 years, 2 months ago
I'm importing a wav file and playing it with the waveOutWrite function only to have the music being played too fast because the WAVEFORMATEX uses stereo and the wav data is mono.
How do I convert the wav data from mono to stereo. I already tried a boat load of things and can't seem to find a solution :S.
Mono to stereo using code?
Just allocate a buffer twice the size of the original PCM data, and for every sample in the original buffer put it twice in the new buffer (you can get the sample size from the wav header, should be usually 16bits)
Advertisement
Hello,
You could also simply use any wave-editing software or a sequencer to convert the .wav(s) to stereo.
E.g. Audacity can do that, and it's free.

Check out my Music/Sound Design Reel on moritzpgkatz.de


Mono to stereo using code?
Just allocate a buffer twice the size of the original PCM data, and for every sample in the original buffer put it twice in the new buffer (you can get the sample size from the wav header, should be usually 16bits)


Thx for the help, that fixed it.

This topic is closed to new replies.

Advertisement