Jump to content
  • Advertisement
Sign in to follow this  

Audio Data Conversion

This topic is 3920 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello All, I have an audio file with the format: WAVEFORMATEX: wFormatTag: 0xfffe nChannels: 8 nSamplesPerSec: 48000 nAvgBytesPerSec: 768000 nBlockAlign: 16 wBitsPerSample: 16 cbSize: 22 (extra bytes) WAVEFORMATEXTENSIBLE: wValidBitsPerSample: 16 dwChannelMask: 0x000000ff SubFormat: {00000001-0000-0010-8000-00AA00389B71} I need to convert it to a simple PCM format with only 2 channels, 48000Hz 16 bits per sample. I tried to sum the 8 channels into 2 channels (even channels to the left and odd channels to the right). When I play the converted file, I hear some of the original channels, but some are missing. Does anyone have an idea how can i convert it correctly? Thanks :-)

Share this post

Link to post
Share on other sites
Firstly you need to find out where the speakers for each of those 8 channels would normally be placed relative to the listener. I'd guess at it being 7.1 channels so you have in order according to: http://www.microsoft.com/windows/windowsmedia/howto/articles/creating71audio.aspx

1 Front left
2 Front right
3 Front centre
4 Low frequency
5 Back left
6 Back right
7 Side left
8 Side right

Assuming that mapping is correct:

Stereo left = 1 + 3 + 4 + 5 + 7
Stereo right = 2 + 3 + 4 + 6 + 8

That will hopefully sound a bit better (the sub and centre speakers will now be mixed into both output channels).

Make sure you clamp the values within range (or normalize them) or you'll get some annoying clicks and pops.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!