tags:

views:

535

answers:

2

I have a program that downloads PCM data from a Web Server, which it uses later to play through a standard PCM player. I want to be able to allow users to change the pitch of the PCM data while its being played.

Does anyone know how to do this?

A: 

I don't know any digital signal processing library for C#, but this seems to be a complete source sample for pitch shifting in .net.:
http://sites.google.com/site/mikescoderama/pitch-shifting

weichsel
+1  A: 

The simplest solution is to play back the sound at a higher sampling rate than it was recorded - playing a 22 kHz file at 44 kHz will double the pitch. You can achieve the same by just throwing away some samples from the sound (bad quality) or resampling the sound (good quality if a good algorithm like sinc interpolation is used).

But there is a dependency - changing the pitch by playing back at different sampling rates will not only change the pitch, but the length of the sound, too. It is possible to change the duration and pitch independently, but that is not that easy and involves a fair amount of singnal processing to achieve good quality. It is usually done in the frequency domain using Fast Fourier Transformations.

Daniel Brückner