Sign in to follow this  

Audio Data Conversion

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:

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this