Closed satyajitghana closed 3 years ago
FULL
Important: Result of the command : flutter pub deps | grep flutter_sound
flutter pub deps | grep flutter_sound
|-- flutter_sound 8.1.1 | |-- flutter... | |-- flutter_sound_platform_interface 8.1.1 | | |-- flutter... | | |-- meta... | | '-- plugin_platform_interface... | |-- flutter_sound_web 8.1.1 | | |-- flutter... | | |-- flutter_sound_platform_interface... | | |-- flutter_web_plugins... | | |-- js... | | '-- meta... | |-- flutter_spinkit 5.0.0 | | '-- flutter... | |-- logger 1.0.0 | |-- path... | |-- path_provider... | |-- provider 5.0.0 | | |-- collection... | | |-- flutter... | | '-- nested 1.0.0 | | '-- flutter...
Describe the bug
Future<String> getTempAudioFile() async { var uuid = Uuid(); String path; var tmpDir = await getTemporaryDirectory(); path = '${join(tmpDir.path, uuid.v4())}.m4a'; var parent = dirname(path); Directory(parent).createSync(recursive: true); return path; } Future<void> resetAudioTrack() async { String path = await getTempAudioFile(); recordingFile = path; track = Track(trackPath: recordingFile, codec: Codec.aacMP4); setState(() {}); }
The Audio is supposed to be recorded as aacMP4, but i am not able to play this audio on a web browser. It DOES play on VLC
This is what vlc shows the codec as
To Reproduce Steps to reproduce the behavior:
<audio controls> <source src="b82ebf5d-6198-4032-98bf-bf93ffcd24e6_1621252991.m4a" type="audio/ogg"> </audio>
NOTE: The file type audio/ogg doesn't really affect it to be not playing, it should still work.
audio/ogg
BUT If I use ffmpeg to simply convert this to a standard AAC/MP3 format it DOES play on web.
W/cident_reporte(24534): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed) I/flutter (24534): FS:---> openAudioSession I/flutter (24534): ---> openAudioSession I/flutter (24534): Resetting flutter_sound Recorder Plugin I/AudioManager(24534): In stopBluetoothSco(), calling application: I/AudioManager(24534): In setBluetoothScoOn(), on: false, calling application: I/AudioManager(24534): In setSpeakerphoneOn(), on: true, calling application: I/AudioManager(24534): In setSpeakerphoneOn(), on: true, calling application: I/AudioManager(24534): In setBluetoothScoOn(), on: false, calling application: I/AudioManager(24534): In stopBluetoothSco(), calling application: I/flutter (24534): ---> openRecorderCompleted: true I/flutter (24534): <--- openRecorderCompleted: true I/flutter (24534): <--- openAudioSession I/flutter (24534): FS:<--- openAudioSession I/flutter (24534): FS:---> startRecorder I/flutter (24534): FS:---> _startRecorder. I/flutter (24534): Calling instance.startRecorder I/flutter (24534): ---> startRecorderCompleted: true I/flutter (24534): <--- startRecorderCompleted: true I/flutter (24534): FS:<--- _startRecorder. I/flutter (24534): FS:<--- startRecorder W/cident_reporte(24534): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed) W/cident_reporte(24534): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed) I/flutter (24534): FS:---> stopRecorder I/flutter (24534): FS:---> stopRecorder I/flutter (24534): FS:---> stop I/flutter (24534): ---> stopRecorderCompleted: true I/flutter (24534): <---- stopRecorderCompleted: true I/flutter (24534): FS:<--- stop I/flutter (24534): FS:<--- stopRecorder : /data/user/0/cache/b82ebf5d-6198-4032-98bf-bf93ffcd24e6.m4a I/flutter (24534): FS:<--- stopRecorder I/flutter (24534): FS:---> closeAudioSession I/flutter (24534): FS:---> closeAudioSession I/flutter (24534): FS:---> stop I/flutter (24534): ---> stopRecorderCompleted: true I/flutter (24534): <---- stopRecorderCompleted: true I/flutter (24534): FS:<--- stop I/flutter (24534): FS:---> openAudioSession I/flutter (24534): Resetting flutter_sound Player Plugin I/flutter (24534): ---> closeRecorderCompleted I/flutter (24534): <--- closeRecorderCompleted I/flutter (24534): FS:<--- closeAudioSession I/flutter (24534): FS:<--- closeAudioSession D/MediaBrowserCompat(24534): Connecting to a MediaBrowserService. I/AudioManager(24534): In stopBluetoothSco(), calling application: I/AudioManager(24534): In setBluetoothScoOn(), on: false, calling application: I/AudioManager(24534): In setSpeakerphoneOn(), on: true, calling application: I/AudioManager(24534): In setSpeakerphoneOn(), on: true, calling application: I/AudioManager(24534): In setBluetoothScoOn(), on: false, calling application: I/AudioManager(24534): In stopBluetoothSco(), calling application: I/flutter (24534): FS:<--- openAudioSession I/flutter (24534): FS:---> channelMethodCallHandler : openPlayerCompleted I/flutter (24534): ---> openPlayerCompleted: true I/flutter (24534): <--- openPlayerCompleted: true I/flutter (24534): FS:<--- channelMethodCallHandler : openPlayerCompleted I/flutter (24534): FS:---> setSubscriptionDuration I/flutter (24534): FS:<---- setSubscriptionDuration I/flutter (24534): FS:---> startPlayerFromTrack I/flutter (24534): FS:---> stop I/flutter (24534): FS:---> channelMethodCallHandler : stopPlayerCompleted E/MediaPlayerNative(24534): stop called in state 1, mPlayer(0x0) E/MediaPlayerNative(24534): error (-38, 0) I/flutter (24534): ---> stopPlayerCompleted: true I/flutter (24534): <--- stopPlayerCompleted: true I/flutter (24534): FS:<--- channelMethodCallHandler : stopPlayerCompleted I/flutter (24534): FS:<--- stop V/MediaPlayer(24534): resetDrmState: mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false V/MediaPlayer(24534): cleanDrmObj: mDrmObj=null mDrmSessionId=null I/flutter (24534): FS:---> _convert I/flutter (24534): FS:---> needToConvert I/flutter (24534): FS:<--- needToConvert I/flutter (24534): FS:<--- _convert I/flutter (24534): FS:---> channelMethodCallHandler : updatePlaybackState I/flutter (24534): FS:<--- channelMethodCallHandler : updatePlaybackState I/flutter (24534): FS:---> channelMethodCallHandler : stopPlayerCompleted I/flutter (24534): ---> stopPlayerCompleted: true I/flutter (24534): Error : cannot process stopPlayerCompleted I/flutter (24534): <--- stopPlayerCompleted: true I/flutter (24534): FS:<--- channelMethodCallHandler : stopPlayerCompleted E/MediaPlayerNative(24534): stop called in state 0, mPlayer(0x0) I/flutter (24534): FS:<--- startPlayerFromTrack V/MediaPlayer(24534): resetDrmState: mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false V/MediaPlayer(24534): cleanDrmObj: mDrmObj=null mDrmSessionId=null I/flutter (24534): FS:---> channelMethodCallHandler : updatePlaybackState I/flutter (24534): FS:<--- channelMethodCallHandler : updatePlaybackState V/MediaPlayer(24534): resetDrmState: mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false V/MediaPlayer(24534): cleanDrmObj: mDrmObj=null mDrmSessionId=null I/flutter (24534): FS:---> channelMethodCallHandler : startPlayerCompleted I/flutter (24534): ---> startPlayerCompleted: true I/flutter (24534): <--- startPlayerCompleted: true I/flutter (24534): FS:<--- channelMethodCallHandler : startPlayerCompleted I/flutter (24534): FS:---> channelMethodCallHandler : updatePlaybackState I/flutter (24534): FS:<--- channelMethodCallHandler : updatePlaybackState I/flutter (24534): FS:---> pausePlayer I/flutter (24534): FS:---> _pausePlayer I/flutter (24534): FS:---> channelMethodCallHandler : pausePlayerCompleted I/flutter (24534): ---> pausePlayerCompleted: true I/flutter (24534): <--- pausePlayerCompleted: true I/flutter (24534): FS:<--- channelMethodCallHandler : pausePlayerCompleted I/flutter (24534): FS:<--- _pausePlayer I/flutter (24534): FS:<--- pausePlayer
Fixed it, had to use the Codec in recorder as well, i thought mentioning it in Track was enough
Good point. This must be improved.
Flutter Sound Version :
FULL
Important: Result of the command :
flutter pub deps | grep flutter_sound
Severity
Platforms you faced the error
Describe the bug
The Audio is supposed to be recorded as aacMP4, but i am not able to play this audio on a web browser. It DOES play on VLC
This is what vlc shows the codec as
To Reproduce Steps to reproduce the behavior:
NOTE: The file type
audio/ogg
doesn't really affect it to be not playing, it should still work.BUT If I use ffmpeg to simply convert this to a standard AAC/MP3 format it DOES play on web.
Logs!!!!