Using Sound files C# - modifying tempo

5.8k views Asked by At

Does anyone have any idea how to modify the sound speed and play a sound file faster/slower than the original in C#?

At the moment I am using .wav files, I have searched a lot and found that SoundPlayer and AudioVideoPlayback are the only two options to play sound, but none of them contain any special method to increase or decrease the sound speed with which to play with.

I am building a piano application which lets user modify the tempo, this is the situation I am in at the moment. I hope a few musical programmers can help me! Cheers

2

There are 2 answers

1
evasilchenko On BEST ANSWER

A similar question was asked earlier:

C# Audio Library

One of the answers there suggested the following tool which might be helpful to you:

http://naudio.codeplex.com/

0
al01 On

What you are looking for is a time-stretch audio library, which changes the playback speed but not the pitch -- with almost no artefacts.

A few excellent timestretch libraries available:

dirac: http://www.dspdimension.com/ (best)

rubberband: http://breakfastquay.com/rubberband/