Solved

Sample Code for using ACM to convert a WAV file

Posted on 1997-06-30
4
473 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
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…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…

695 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