react-native-audio-toolkit icon indicating copy to clipboard operation
react-native-audio-toolkit copied to clipboard

Audio not playing on some Android devices

Open asavardplante opened this issue 6 years ago • 18 comments

After some tweaking to add the library to my project, I finally managed to make the player plays my record. Everything works fine, except that on some android device (LG G4, Android 6.0) The player won't play any sound. It works fine on my colleague's device ( which are also androids) and every iOS devices, but for some Android, it doesn't...

Any idea/solution to fix this problem?

I already tried @xstable branch https://github.com/react-native-community/react-native-audio-toolkit/issues/149 but the problem still persists 🤔

asavardplante avatar Feb 20 '20 22:02 asavardplante

You'd better link my ticket, so the people knows what you talking about:

https://github.com/react-native-community/react-native-audio-toolkit/issues/149

You've noticed, that there was a little issue in my answer? In the second code-script, you have to choose aac-lc for sure, I had there only aac (now I fixed it).

image

xstable avatar Feb 21 '20 11:02 xstable

Sadly it still doesn't work even with your fix, but what I notice is that the state on the devices that won't play sound returns state: -1

asavardplante avatar Feb 21 '20 13:02 asavardplante

any update? I found it doesn't work on Huawei devices.

chj-damon avatar Feb 28 '20 09:02 chj-damon

Also looking for any answers to this. I've made the above change. It looks like it is recording and records the length of the sound byte but no sound is on the file.

nikiyasimpson avatar Mar 12 '20 13:03 nikiyasimpson

@xstable you are recording, but we are playing... maybe they are different?

chj-damon avatar Mar 13 '20 10:03 chj-damon

I can record and play on iOS device. On Android, the file plays but there is no sound. I think it has recorded something based on the length of the audio file but when I listen to it, there is nothing.

nikiyasimpson avatar Mar 13 '20 12:03 nikiyasimpson

I also encounter the audio playing issue on some Android devices. After rolling out my new version of app with this library, there're some users started to complain that audio play is broken.

CoSNaYe avatar Mar 14 '20 04:03 CoSNaYe

same her even with emulator, seems playing but no voice

ykcadcg avatar Mar 15 '20 06:03 ykcadcg

Any update on how to fix/ workaround? Urgent, thanks~

ykcadcg avatar Mar 15 '20 15:03 ykcadcg

Same problem here

nikbelikov avatar Apr 21 '20 09:04 nikbelikov

I also have this problem, state: -1 nothing seems to work on android

klaaz0r avatar Apr 21 '20 19:04 klaaz0r

I have the same problem. Please help. iOS works perfectly but for android, the prepare is not working at all. No callback.

hussainarthuna avatar Apr 27 '20 17:04 hussainarthuna

I have the same problem for Huawei phones.

krean93 avatar May 02 '20 18:05 krean93

使用react-native-video可解决问题

jimtang9527 avatar Jul 10 '20 07:07 jimtang9527

I have the same problem for Huawei and HTC phones.

ksoghoyan avatar Jul 13 '20 10:07 ksoghoyan

Any updates on this?

superplussed avatar Jul 28 '20 09:07 superplussed

I have the same problem. Please help. iOS works perfectly but for android, the prepare is not working at all. No callback.

Same problem on all android phones. Any solution?

oshri-humanz avatar Aug 26 '20 10:08 oshri-humanz

Prepare is working for me when file is local. But prepare is not working and causing errors when audio file is remote. When I updated shouldUpdateProgressBar remote files worked again for me:

shouldUpdateProgressBar() { return this.player && this.player.duration >= 0 && Date.now() - this.lastSeek > 200; }

kidequinox avatar Sep 11 '20 17:09 kidequinox