Programmatically increase the pitch of an array of audio samples

后端 未结 6 1943
心在旅途
心在旅途 2020-12-08 03:39

Hello kind people of the audio computing world,

I have an array of samples that respresent a recording. Let us say that it is 5 seconds at 44100Hz. How would I play

6条回答
  •  生来不讨喜
    2020-12-08 04:06

    If you want this done easily, see AShelly's suggestion [edit: as a matter of fact, try it first anyway]. If you need good quality, you basically need a phase vocoder.

    The very basic idea of a phase vocoder is to find the frequencies that the sound consists of, change those frequencies as needed and resynthesize the sound. So a brutal simplification would be:

    1. run FFT
    2. change all frequencies by a factor
    3. run inverse FFT

    If you're going to implement this yourself, you definitely should read a thorough explanation of how a phase vocoder works. The algorithm really needs many more considerations than the three-step simplification above.

    Of course, ready-made implementations exist, but from the question I gather you want to do this yourself.

提交回复
热议问题