hyochan / react-native-audio-recorder-player

react-native native module for audio recorder and player.
MIT License
681 stars 203 forks source link

Stop and pause player not working #587

Open parthpanchalTAI opened 4 months ago

parthpanchalTAI commented 4 months ago

const audioRecorderPlayer = new AudioRecorderPlayer();

const onPausePlay = async () => { await audioRecorderPlayer.audioRecorderPlayer.pausePlayer(); };

const onStopPlay = async () => { console.log('onStopPlay'); await audioRecorderPlayer.stopPlayer(); audioRecorderPlayer.removePlayBackListener(); };

This two methods are not working, audio is continuous play on background, in both android and ios

saribalorhan commented 4 months ago

same here

saribalorhan commented 4 months ago

@parthpanchalTAI when I add 'Background processing' to the my project, it seems working fine but it's still not stable. 2-3 sessions working fine but some it's not. Before adding this, it was not working at all.

Screenshot 2024-02-22 at 09 13 14
chetanbhadarka commented 4 months ago

Hi @saribalorhan @parthpanchalTAI, Please make sure you defined the constant of audio player outside the component.

import....

const audioRecorderPlayer = new AudioRecorderPlayer();

const App()=>{}