Solved

Sample Code for using ACM to convert a WAV file

Posted on 1997-06-30
4
468 Views
Last Modified: 2013-12-03
Can someone give me a sample code in C++ that is easy to read and understand on using ACM (Audio Compression Manager) to convert a WAV file say from 16-Bit Stereo to 8-Bit Mono, including converting the sample rate as well.  
0
Comment
Question by:dannil
  • 2
4 Comments
 
LVL 1

Expert Comment

by:dtowell
ID: 1399644
Don't bother with ACM, just read the samples and write them yourself.  Use the following conversions:

16bit to 8bit:  use only the top 8 bits for each sample
8bit to 16bit:  duplicate the 8bits for each half of the sample
stereo to mono(easy): choose left or right chanel, ignore other
stereo to mono(hard): add left and right and divide by 2
mono to stereo: duplicate data for both channels
22k to 11k: use every other sample
44k to 22k: use every other sample
22k to 44k(easy): duplicate every sample
22k to 44k(hard): interpolate between samples
11k to 22k:  see 22k to 44k
0
 
LVL 23

Accepted Solution

by:
chensu earned 50 total points
ID: 1399645
There is an example code called "ACMApp" that comes with Video for Windows 1.1 DK. I can send it to you by E-Mail. (Please tell me your E-Mail address.)
0
 

Expert Comment

by:xyzhuang
ID: 1399646
The windows default drivers can not convert the waveform with
sample rate bigger than 48KHz!
So if you want to know the algorithm, please let me know.
0
 
LVL 23

Expert Comment

by:chensu
ID: 1399647
You can refer to WAVEMIX DLL source code. The source code contains some functions to convert standard PCM formats by resampling. You can find it on Microsoft Multimedia JumpStart 2.0 CD-ROM or Microsoft FTP site (I am not sure).
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question