使用 VB.net 进行宣传
我想在任何时候获得歌曲的音高。我计划稍后存储这些音调。我怎样才能读取... mp3 文件或 wav 文件来在某个点播放音调?
这是一个视觉示例: 假设我想获得歌曲^此时的音调。
如果可以的话谢谢!
I want to get the pitch of a song at any point. I plan on storing the pitches later. How can I read say... an mp3 file or wav file to get the pitch played at a certain point?
Here is a visual example:
Say I wanted to get the pitch that is here at ^this point of the song.
Thanks if you can!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事情比你想象的要复杂一些。
虽然存在时域方法(即直接处理 PCM 数据的方法),但频域基音检测将更加准确。您可以在此处阅读非常简化的概述。
您可能想要的是 傅里叶变换,它可用于将信号块从时域到频域(即给定信号跨度上的频率内容分布)。从那里,您需要分析该块内的频谱。这个问题变得更加困难,因为在一般情况下没有最佳方法从采样的频谱中推断音调。上述维基百科文章应该为您研究这些算法奠定基础。
最后,值得注意的是,这实际上是一个与语言无关的问题,除非您的主要兴趣是 阅读 WAV 文件 专门使用 VB.NET。
The matter is a tad more complicated than you may be anticipating.
While time-domain approaches exist (that is, approaches which work with the PCM data directly), frequency-domain pitch detection is going to be more accurate. You can read a very simplified overview here.
What you probably want is a Fourier Transform, which can be used to transform blocks of your signal from time-domain to frequency-domain (that is, a distribution of frequency content over a given span of the signal). From there, you would need to analyze the frequency spectrum within that block. The problem becomes even harder still, because there is no best way to deduce pitch from a sampled frequency spectrum in the general case. The aforementioned Wikipedia article should give you a foundation for looking into those algorithms.
Finally, it's worth noting that this is really a language-agnostic question, unless your primary interest is in reading a WAV file specifically using VB.NET.