During voice communication, you often encounter situations where you need to convert audio signals of a certain format into audio signals of another format and mix two or more audio signals. For more information, see the information found on the Internet, I made an example. ProgramThis program can convert two 8-bit 8000 sample 1 channel pcm a-Law audio files into 16-bit 8000 sample 1 channel PCM line audio data that is easy to mix, then, the two signals are mixed, and the mixing result is converted to 8bit 8000 sample 1 channel pcm a-Law format for storage.
ACM is used for format conversion. For details, refer to calling ACM audio programming interface to compress wave audio under VC (for the original article, refer to Google ), mixing is accumulated using the simplest linear accumulation method.
I provide two files a1.pcm and a2.pcm. Click the convert button to convert the two files to b1.pcm and b2.pcm. After these two files are generated, click the mix button to mix b1.pcm and b2.pcm and generate M. PCM.
The formats of a1.pcm, a2.pcm, and M. PCM are 8bit 8000 sample 1 channel pcm a-Law.
B1.pcm and b2.pcm are in 16bit 8000 sample 1 channel PCM line format.
The preceding files can be opened using cooledit or Adobe audition.
The project is based on codegear C ++ builder 2007 and passes debugging on Windows Server 2003 and Vista.
CodeDownload: Click here to download