Closed pacifio closed 3 years ago
Hi! I have the same error but when running
final player = AudioCache();
player.play("note7.wav");
Have no idea what the problem is
Hello,
I had exactly same issue, but flutter pub upgrade
solve the problem.
I was running version 1.13.5
of audioplayers.
yes, same worked for me, thanks
I was having the same issue and none of the proposed solutions worked for me. Turns out the URL I was using was making some sort of redirection to the source so when the service tried to reach the source from the first URL all it got was an html with the redirection rule so thats what generated the issue for me. Try and see if the URL you are using is returning the audio file immediately or not
@ElZombieIsra is correct. If the URL provided is not a direct audio file, then this error occurs. This likely isn't a library error.
Currently having the same issue. pub upgrade not working for me
Currently having the same issue. pub upgrade not working for me
I am using AudioCache
to play every 10-60s a short sound, in .ogg
format, of a few hundred milliseconds. It all works fine, but after a few minutes I always get the same error.
I am on Android 9 together with the newest release 0.16.2
E/MediaPlayerNative(25640): error (1, -19)
E/MediaPlayer(25640): Error (1,-19)
E/MediaPlayerNative(25640): pause called in state 0, mPlayer(0x7101adfe3ec0)
E/MediaPlayerNative(25640): error (-38, 0)
E/MediaPlayerNative(25640): Attempt to perform seekTo in wrong state: mPlayer=0x7101adfe3ec0, mCurrentState=0
E/MediaPlayerNative(25640): error (-38, 0)
E/MediaPlayer(25640): Error (-38,0)
E/MediaPlayer(25640): Error (-38,0)
...
Using an fixed AudioPlayer
instance seems to fix the problem for me. This works only, if the sounds do not overlap.
@braniii am facing the same problem :( can you share with me how you create a fixed Audio player instance ?
Hi @wael-Fadlallah
I got the similar issue and creating the AudioCache instance with fixedPlayer named parameter resolved my issue.
AudioPlayer fixedPlayer = new AudioPlayer();
AudioCache player = AudioCache(fixedPlayer: fixedPlayer);
Hey @claudehsu thanks for replaying
I have try your fix but sadly I got some error after playing multiple tracks
Unhandled Exception: PlatformException(Unexpected error!, Unable to access resource, java.lang.RuntimeException: Unable to access resource
and then the player stop playing
seems like I have same issues here. Here's my log when try to play audio from url
...
W/System: ClassLoader referenced unknown path: system/framework/mediatek-cta.jar
I/System.out: [okhttp] e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaUtils
I/System.out: [okhttp]:check permission begin!
W/System: ClassLoader referenced unknown path: system/framework/mediatek-cta.jar
[okhttp] e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaUtils
I/System.out: [okhttp]:check permission begin!
W/System: ClassLoader referenced unknown path: system/framework/mediatek-cta.jar
I/System.out: [okhttp] e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaUtils
E/MediaPlayerNative: error (1, -2147483648)
E/MediaPlayer: Error (1,-2147483648)
*edit, im adding another error that appears in my log
28308-28373 E/MediaPlayerNative: error (1, -2147483648)
28308-28308 E/MediaPlayer: Error (1,-2147483648)
28308-28308 E/MediaPlayerNative: stop called in state 0, mPlayer(0x895ee740)
28308-28308 E/MediaPlayerNative: error (-38, 0)
@braniii am facing the same problem :( can you share with me how you create a fixed Audio player instance ?
Sorry for the late reply. I am using following lines, but I am using only local files. With this snippet I am able to run a Tabata timer with 6-10 500ms sounds per minute for at least 40 minutes without any crash.
AudioPlayer audioPlayerInstance = AudioPlayer()..setReleaseMode(ReleaseMode.STOP);
AudioCache audioCache = AudioCache(fixedPlayer: audioPlayerInstance);
await audioCache.loadAll(<String>[...]); // list with audio files
Just printing error in onPlayerError
. I got this unknown error after AudioPlayerState
turn to STOP
18413-18547 I/flutter: audioplayer error: MediaPlayer error with what:MEDIA_ERROR_UNKNOWN {what:1} extra:MEDIA_ERROR_SYSTEM
18413-18547 I/flutter: _platformCallHandler call audio.onComplete {value: true, playerId: ef0254f5-dde6-430c-bf30-a97f679ab2d7}
based from this issue #165 , there something with clearTextTraffic
, but i already adding android:usesCleartextTraffic="true"
INTERNET permission, etc, but it not work.
anyway, i am using latest audiopalyers (0.17.0), with android SDK 29
same issue
Any updates on this?
ah, I almost forgot about this issue. So after deeply search, there is no issue for the code imo. In my case, the problem is from the API itself. After I check the headers of the API, the Content-Type
is set to text/html
, not audio/xwav
.
just try another open source audio url like this to check whether the function is work or not.
I use the music in the assets folder, but the same error occurs. Same for other libraries
Hey, everyone. I found myself encountering this error again today. The solution was the same I said before, the URL that I was using returned a redirect rule instead of the actual file.
Double-check if your URL is returning the actual file.
Consider to add human-readable error for this issue
Same issue here !
I try to play music in my assets folder. It works perfectly fine on the iPhone emulator, but I get this error when I try it on Android.
Has anyone found a solution ?
Thanks in advance for your help
E/MediaPlayerNative( 8001): error (1, -2147483648)
E/MediaPlayer( 8001): Error (1,-2147483648)
E/MediaPlayerNative( 8001): pause called in state 0, mPlayer(0xaf81bf70)
E/MediaPlayerNative( 8001): error (-38, 0)
E/MediaPlayerNative( 8001): Attempt to perform seekTo in wrong state: mPlayer=0xaf81bf70, mCurrentState=0
E/MediaPlayerNative( 8001): error (-38, 0)
@ElZombieIsra that is definitely the original issue, just by opening it on the browser you can see the real URL is:
https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3
I should add this to the FAQ, seems to be a very common issue.
@luanpotter did you added the FAQ entry so we can close this?
@erickzanardo how about: https://github.com/luanpotter/audioplayers/pull/845
I was getting the exact same error. My problem was I forgot to put the scheme in the audio URL. 🤦♂️ I tacked http:// to the front of it and solved the problem!
2021-09-15 10:19:30.001 32611-32611/mening.dasturim.recyclerview E/im.recyclervie: Invalid ID 0x00000000. 2021-09-15 10:19:31.872 32611-2053/mening.dasturim.recyclerview E/MediaPlayerNative: error (1, -1015) 2021-09-15 10:19:31.875 32611-32611/mening.dasturim.recyclerview E/MediaPlayer: Error (1,-1015)
Hi! I have the same error but when running
final player = AudioCache(); player.play("note7.wav");
Have no idea what the problem is
anyone can find solution for this plz tell me and i try ti find from last 1 week and not able to find any solution for this
Code
Error
I even added
usesCleartextTraffic
in android manifest file