Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onPress={() => {
if (playback.isLoaded) {
const newRate = playback.rate < 1 ? 1 : 0.5;
playback.sound.setRateAsync(
newRate,
playback.shouldCorrectPitch,
Audio.PitchCorrectionQuality.High
);
}
}}
/>
_setRateAsync = async (
rate: number,
shouldCorrectPitch: boolean,
pitchCorrectionQuality = Audio.PitchCorrectionQuality.Low
) => {
await this._sound!.setRateAsync(rate, shouldCorrectPitch, pitchCorrectionQuality);
};