2
$\begingroup$

I am importing an audiofile to Mathematica and want to play it back at double speed. The only functions I see are the advanced options of AudioPitchShift (which doesn't alter the duration but increases the pitch) and AudioTimeStretch (which doesn't alter the pitch but does alter the duration). However, I want it both at the same time, half the duration, double the pitch. Which function should I use?

$\endgroup$
2
  • $\begingroup$ Can't you compose those two together, with a judicious setting of options, to achieve the result you want ? ie, something like AudioTimeStretch[AudioPitchShift[myaudiofile, dp], 0.5] $\endgroup$ – High Performance Mark May 27 '19 at 15:19
  • $\begingroup$ Yes I can, but I suspect there is a faster & simpler option which I am overlooking $\endgroup$ – DM037 May 27 '19 at 15:24
1
$\begingroup$

I was looking for the same. The best I came up with is this (replace a with your audio):

AudioPlay[Audio[AudioData[a],SampleRate->AudioSampleRate[a]*2]]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.