Play a sound at different speed

Hi there,

for the project I’m working on I need to play a sound at different speed. Every single sound playing library I came accross was able to do this. I’ve seen that Audacity is able to do it. So I’m wondering:

  • How do you achieve this ? Which library do you use ? Could you point out where is the code related to this ?
  • Is it possible to somehow remote control audacity from my application to play my sound ?

Thanks for your help,

Jean-Charles

Do you mean changing the tempo and pitch (resampling) or changing the tempo without changing the pitch (time stretching)?

The first one, I mean changing the tempo and the pitch.

Audacity uses (depending on the build) either libreample, or libsamplerate or libsoxr.

If you are looking for command line access to resampling, have a look at SoX http://sox.sourceforge.net/Docs/Features
If you just want the library, see libsoxr.