0
votes

I am trying to change the rate of a sound file played through AVAudioPlayer. It works, but there are significant artifacts, especially when I slow down the rate. I'm happy that the rate change maintains the same pitch but it seems to have trouble, especially with sustained notes.

It seemed like the rate change was working pretty well until I tried it with higher quality sounds that had been equalized, compressed, and mastered. I'm concerned that the AVAudioPlayer rate change can't deal with the higher quality.

I'm using .wav files with a sample rate of 48kHz and 16 bits per sample.

I've also looked into ZTX Time Stretching and Pitch Shifting, formerly known as Dirac LE, but haven't been able to acquire a license for the software yet. However, I did try loading the files into iPhone apps that use the ZTX technology and it had similar issues.

Any help or suggestions would be appreciated!

1
Have you tried using a different format. PCM, MP3 etc? The files you mention in your question, are these the "High Quality" ones that are breaking? What was the quality of the sounds that was working before?Beau Nouvelle
By "High Quality" does that imply more high frequency components and/or higher frequency sound? How much are you slowing the sound down? Are you are using LPCM, if so the dynamic range is rather limited.zaph
By high quality, I mean that a sound engineer has worked with the files to bring out more of the treble and/or bass components of the sound (depending on the instrument). I'm finding that the treble/higher frequency sounds are getting distorted. I haven't tried using PCM, but I've heard that's for raw uncompressed sound. I'll to export the files as uncompressed PCM and see how that works. MP3 won't work with the AVAudioPlayer. Thanks for the suggestions!Kate
Isn't WAV a type of PCM? I'll try AIFF or another PCM format.Kate

1 Answers

0
votes

There are fewer data points per cycle at higher frequencies getting close to two per cycle at 20 khz. Slowing down the audio with the same pitch involves adding more data points and that can't be completely accurate because that information was not present in the original.

Further the process of changing the speed without altering the pitch is a complex operation. The more the sound is slowed the more artifacts that will be introduced. Note: You still have not stated what kind of slowing ration you are going for, 90%, 50%, 10%?

If the amount of slowing is extreme use a higher sampling frequency.