Question

Help me, please. I have 3 wav file. 1.wav file plays with 0-10 seconds, 2.wav file playing with 3-7 second, and 3.wav file playing from 5 - 8.25 second. Tracks are playing simultaneously.

How to mixing or combine in C# code them into one file to get a wav file length of 10 seconds?

Target platform Windows Phone or Windows 8 Store App without the use of third-party libraries. All files are identical: 16 bit, 44100, stereo.

How to mix files to correctly position the time in c# code?

Was it helpful?

Solution

There are several ways to do it.

My recommendation is to write a custom wave class which can read and write wave files, because unlike some other music files, the main info of a wave file is stored in its header.

Here's the detailed wave file format specification. https://ccrma.stanford.edu/courses/422/projects/WaveFormat/

Another way to bypass the painful decoding is using a third party library, such as NAudio.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top