Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Sample Code for using ACM to convert a WAV file

Posted on 1997-06-30
4
Medium Priority
?
476 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 100 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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 describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

636 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