Closed mehmetext closed 4 years ago
It may be that the file is corrupt, the wav type issue if the player isn't comfortable at parsing it. Try playing a different wav file and see if the problem persists.
It may be that the file is corrupt, the wav type issue if the player isn't comfortable at parsing it. Try playing a different wav file and see if the problem persists.
Actually I use flutter_audio_recorder to record audio. I want to play what I record with assets_audio_play. @johnny-stevie
It may be that the file is corrupt, the wav type issue if the player isn't comfortable at parsing it. Try playing a different wav file and see if the problem persists.
Actually I use flutter_audio_recorder to record audio. I want to play what I record with assets_audio_play. @johnny-stevie
@mehmetext change audio recording format with .m4a and try again. Because as i understand it is playback app no need to store with wav extension.
Try creating another recording with another file format like mp4, or just playing a different wav file thats off the web. If neither work, then I would do a flutter clean build
and recompile.
I tried another audio (format: .aac) from file. It plays but it doesn't give the audio duration 🤔 Also I did flutter clean so much :D
It may be that the file is corrupt, the wav type issue if the player isn't comfortable at parsing it. Try playing a different wav file and see if the problem persists.
Actually I use flutter_audio_recorder to record audio. I want to play what I record with assets_audio_play. @johnny-stevie
@mehmetext change audio recording format with .m4a and try again. Because as i understand it is playback app no need to store with wav extension.
@kalismeras61 I tried it but nothing changed. It gives same error.
@mehmetext it looks like recorder plugin problem.
Check this : https://github.com/rmbrone/flutter_audio_recorder/issues/11
Solution : https://github.com/rmbrone/flutter_audio_recorder/issues/11#issuecomment-654289094
It would be best if you did 2 thorough tests:
_assetsAudioPlayer.duration.listen((){})
? I'm not sure about the exact stream name, but you have to subscribe to it to get the latest audio duration.@mehmetext it looks like recorder plugin problem.
Check this : rmbrone/flutter_audio_recorder#11
Solution : rmbrone/flutter_audio_recorder#11 (comment)
@kalismeras61 I tried this solution but it couldn't solve my problem. Also, I think there is no problem about recorder plugin. Because I can play it one time but I can not play it or something else more. And I used audio_recorder plugin instead of flutter_audio_recorder plugin. The problem is same again 🤔
It would be best if you did 2 thorough tests:
- Test every recording file format and see if you get the error.
- Try playing external files of the same formats(not recordings but something off the web) And posted your error logs instead of just describing them. Also, about the audio duration, did you do
_assetsAudioPlayer.duration.listen((){})
? I'm not sure about the exact stream name, but you have to subscribe to it to get the latest audio duration.
@johnny-stevie I use PlayerBuilder.realtimePlayingInfos, so I can get audio duration. Audio from network gives but Audio from file doesn't give me the duration. Actually there is no error logs in terminal 🤔
Did you try using the record_mp3 package like in the issue referenced by @kalismeras61 ?
Did you try using the record_mp3 package like in the issue referenced by @kalismeras61 ?
@kalismeras61, @johnny-stevie thank you so much. I used record_mp3 plugin and there is no problem for now.
@mehmetext ok cool. If it is fixed. Please close this issue.
Flutter Version
My version : 1.20.3
Platform (Android / iOS / web) + version
Platform : Android 9.0
Describe the bug
when I want to play an audio from local(Audio.file), I can play it but it gives an error like this: https://prnt.sc/ue5a5x. Then If I play again it, it doesn't give any error and it doesn't play.
Small code to reproduce