hyochan / react-native-audio-recorder-player

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

currentPosition jumps back to start occasionally on Android #496

Open andreiZi opened 1 year ago

andreiZi commented 1 year ago

Please fill the template to help you out. Also, please try the Example project compare before submiting the issue when you have certain issue with your project setup.

Version of react-native-audio-recorder-player

3.5.1

Version of React Native

0.70.5

Version of Android

Android Tiramisu

Device

Pixel 3a

Platforms you faced the error (IOS or Android or both?)

Android

Expected behavior

the recording should play without jumping back randomly to the beginning

Actual behavior

When playing voice recordings on android, the current position occasionally jumps back.

You can see in the log that the audio player jumps to the start at 4460 ms in the first voice record and in the second at 4707 ms.

Example: Untitled

Code:

  1. This first log is only printed once as the player gets instantiated one once (wanted to make sure that I don't have two audio players)

  2. Logs the current position / duration of the voice recording. image

This behavior occurs only on android. The same code works on iOS fine and was thoroughly tested.

Also, sometimes the app crashes with the following error message. I included it here, because I assume that both of the anomalies may be related. image

claudiozam commented 1 year ago

@andreiZi try on a real device. I'am using a Samsung S10 (Android 12) without problems.

andreiZi commented 1 year ago

Thank you @claudiozam for your help.

I went out and purchased a physical Pixel 7 Pro and it works well now. It would be great if the issue could be resolved for future reference, as it caused a lot of frustration when trying to find the cause on an emulator.