PCM Data Pitch Change in C#

为君一笑 提交于 2019-12-22 12:38:27

问题


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?


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/1091198/pcm-data-pitch-change-in-c-sharp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!