0

I'm using react-native-track-player for my audio app. When I use TrackPlayer.setRate to set the rate to a slower speed (0.5), the audio sounds like it's coming from underwater. When I play the same audio file locally using the QuickTime Player, it doesn't sound underwater.

Anyone had the same problem, and found a solution to this?

Eric Cheon
  • 33
  • 1
  • 6

1 Answers1

1

I also got the same problem when working with react-native-track-player in ios and the solution is to use pitch alogorithm. pitchAlgorithm is only for ios.

import TrackPlayer,{ PitchAlgorithm } from 'react-native-track-player';

var track = [];
        for(let i = 0; i < SoundArray.length; i++ ){
          track.push({
            url: SoundArray[i].sound._filename,
            index: SoundArray[i].index,
            duration: SoundArray[i].sound._duration,
            id: SoundArray[i].index.toString(),
            title: SoundArray[i].index.toString(),
            artwork:"https://url_to_artwork.jpg",
            album: ""
          })
        }
        console.log('track', track);
        
        await TrackPlayer.add(track);
        await TrackPlayer.setRate(0.6);
        await TrackPlayer.play();

Zishan Ali
  • 11
  • 3