以20Hz-20,000Hz的频率播放.wav文件 [英] Playing .wav file at frequencies from 20Hz-20,000Hz

查看:223
本文介绍了以20Hz-20,000Hz的频率播放.wav文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用c#开发一个winForm应用程序。我想以不同的频率播放.wav文件(不是以不同的采样率,即440Hz,220Hz等)。我想要20Hz到20,000Hz的可听频率。任何人都可以帮我解决这个问题!

I am developing a winForm application in c#. I want to play a .wav file at different frequencies (not at different sample rates i.e. 440Hz, 220Hz etc.). I want audible frequencies from 20Hz to 20,000Hz. Can anybody help me in this problem!

推荐答案

据我所知,如果你玩一个 WAV 文件在不同的采样率(如果你能做到的话)然后你得到不同的频率(假设你有一个包含440赫兹声音的文件,采样率为8千赫兹,如果你以16千赫兹的采样率使用它的数据那么你得到一个880赫兹声音)。

但是,我想你必须为你想要支持的频率创建不同的WAV文件。
As far as I know, if you play a WAV file at different sample rates (if you can do it) then you get different frequencies (suppose you have a file containing a 440 hz sound at sample rate of 8 khz, if you use its data at 16 khz sample rate then you obtain a 880 hz sound).
I suppose, however, you have to create different WAV files for the frequencies you intend to support.


这就是所谓的换位。最初以C大调演奏的一首歌在E大调中再现。我还没有这样做,但类似的问题是以不同的速度播放而不影响音高。可以找到一个例子,例如在Audacity中(虽然在C ++中)。当您第一次更改速度,然后更改采样率的标题信息时,您应该得到所需的结果。
That's called "transposition" when e.g. a song originally played in C major is reproduced in E major. I haven't yet done that, but a similar problem is playback at different speed without affecting the pitch. An example for that can be found e.g. in Audacity (in C++ though). When you first change the speed, and afterwards change the header information for the sampling rate, you should arrive at the desired result.


这篇关于以20Hz-20,000Hz的频率播放.wav文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆