Solved

Sample Code for using ACM to convert a WAV file

Posted on 1997-06-30
4
463 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now