编程增加音频样本的阵列的间距 [英] Programmatically increase the pitch of an array of audio samples

查看:131
本文介绍了编程增加音频样本的阵列的间距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好音频计算领域的好心人,

Hello kind people of the audio computing world,

我有样本的数组水库present录音。让我们说,它是在44100Hz 5秒。我怎么会打在增加的间距这回?并且是有可能增加和动态减少音调?就像有间距缓慢增加的速度加倍,然后背下来。

I have an array of samples that respresent a recording. Let us say that it is 5 seconds at 44100Hz. How would I play this back at an increased pitch? And is it possible to increase and decrease the pitch dynamically? Like have the pitch slowly increase to double the speed and then back down.

在换句话说,我想借此录制和回放,就好像它是由一个D.J.划伤

In other words I want to take a recording and play it back as if it is being 'scratched' by a d.j.

伪code总是欢迎。我会起来C.写这篇

Pseudocode is always welcomed. I will be writing this up in C.

谢谢,

修改1

让我澄清我的意图。我想保持在44100Hz播放等于是我需要的操纵样品之前播放即可。这也是因为我想为混合有增加的间距与以正常速度运行的音频音频。

Allow me to clarify my intentions. I want to keep the playback at 44100Hz and so therefore I need to manipulate the samples before playback. This is also because I would want to mix the audio that has an increased pitch with audio that is running at a normal rate.

防爆$ P $以另一种方式pssed,也许我需要在同一批样品莫名其妙缩水音频?这样,当它被回放,会发出声音更快?

Expressed in another way, maybe I need to shrink the audio over the same number of samples somehow? That way when it is played back it will sound faster?

编辑2

另外,我想这样做我自己。无库讨好(除非你觉得我可以通过code挑选并找到一些有趣的事情)。

Also, I would like to do this myself. No libraries please (unless you feel I could pick through the code and find something interesting).

编辑3

写在C code的样本一块需要两个参数(样品和间距系数阵列),然后返回新的音频数组将是太棒了!

A sample piece of code written in C that takes 2 arguments (array of samples and pitch factor) and then returns an array of the new audio would be fantastic!

PS我已经开始一个赏金对这个并不是因为我不认为已经给出的答案是无效的。我只是认为这将是很好的获得关于这个问题更多的反馈。

PS I've started a bounty on this not because I don't think the answers already given aren't valid. I just thought it would be good to get more feedback on the subject.

赏金奖

老实说,我希望我能在几个不同的答案分发奖金,因为他们是相当多的,我认为是超级有帮助的。特别大喊答题节目环节丹尼尔传递我一些code和AShelly和Hotpaw2的投入如此详细的答复。

Honestly I wish I could distribute the bounty over several different answers as they were quite a few that I thought were super helpful. Special shoutout to Daniel for passing me some code and AShelly and Hotpaw2 for putting in such detailed responses.

虽然最终我使用一个答案<一个href=\"http://stackoverflow.com/questions/1125666/how-do-you-do-bicubic-or-other-non-linear-interpolation-of-re-sampled-audio-dat\">another SO问题通过datageist引用等奖将归他。

Ultimately though I used an answer from another SO question referenced by datageist and so the award goes to him.

再次感谢大家!

推荐答案

参加Nosredna的回答一看大象纸本(非常类似),这样的问题:
<一href=\"http://stackoverflow.com/questions/1125666/how-do-you-do-bicubic-or-other-non-linear-interpolation-of-re-sampled-audio-dat\">How你做双三次(或其它非直线)重新采样的音频数据的内插?

Take a look at the "Elephant" paper in Nosredna's answer to this (very similar) SO question: How do you do bicubic (or other non-linear) interpolation of re-sampled audio data?

实现范例提供开始第37页,和参考,AShelly的回答相当于直线插补(在同一页面上)。随着一点点的调整,任何在本文的其他公式可以插入到该框架。

Sample implementations are provided starting on page 37, and for reference, AShelly's answer corresponds to linear interpolation (on that same page). With a little tweaking, any of the other formulas in the paper could be plugged into that framework.

有关评估一个给定的插值方法的质量(以及使用便宜方案的理解潜在的问题),看看这个页面:

For evaluating the quality of a given interpolation method (and understanding the potential problems with using "cheaper" schemes), take a look at this page:

http://www.discodsp.com/highlife/aliasing/

有关更多的理论可能比你想处理(附源$ C ​​$ C),这是一个很好的参考,以及:

For more theory than you probably want to deal with (with source code), this is a good reference as well:

https://ccrma​​.stanford.edu/~jos/resample/

这篇关于编程增加音频样本的阵列的间距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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