loonix / another_audio_recorder

(Null-Safe + V2) Audio Record Plugin that supports record, pause, resume, stop, and provide access to audio level metering properties average power peak power.
https://pub.dev/packages/another_audio_recorder
MIT License
5 stars 8 forks source link

TYPE_SOURCE: Expected block size: 2; got: 1 #14

Open AwaisQazii opened 2 weeks ago

AwaisQazii commented 2 weeks ago

Init 54b86c [ExoPlayerLib/2.18.7] [Infinix-X670, Infinix X670, INFINIX, 33] E/ExoPlayerImplInternal(21797): Playback error E/ExoPlayerImplInternal(21797): com.google.android.exoplayer2.ExoPlaybackException: Source error E/ExoPlayerImplInternal(21797): at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:644) E/ExoPlayerImplInternal(21797): at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:614) E/ExoPlayerImplInternal(21797): at android.os.Handler.dispatchMessage(Handler.java:102) E/ExoPlayerImplInternal(21797): at android.os.Looper.loopOnce(Looper.java:204) E/ExoPlayerImplInternal(21797): at android.os.Looper.loop(Looper.java:291) E/ExoPlayerImplInternal(21797): at android.os.HandlerThread.run(HandlerThread.java:67) E/ExoPlayerImplInternal(21797): Caused by: com.google.android.exoplayer2.ParserException: Expected block size: 2; got: 1 E/ExoPlayerImplInternal(21797): at com.google.android.exoplayer2.extractor.wav.WavExtractor$PassthroughOutputWriter.(WavExtractor.java:308) E/ExoPlayerImplInternal(21797): at com.google.android.exoplayer2.extractor.wav.WavExtractor.readFormat(WavExtractor.java:202) E/ExoPlayerImplInternal(21797): at com.google.android.exoplayer2.extractor.wav.WavExtractor.read(WavExtractor.java:134) E/ExoPlayerImplInternal(21797): at com.google.android.exoplayer2.source.BundledExtractorsAdapter.read(BundledExtractorsAdapter.java:127) E/ExoPlayerImplInternal(21797): at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1039) E/ExoPlayerImplInternal(21797): at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412) E/ExoPlayerImplInternal(21797): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) E/ExoPlayerImplInternal(21797): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) E/ExoPlayerImplInternal(21797): at java.lang.Thread.run(Thread.java:1012) E/AudioPlayer(21797): TYPE_SOURCE: Expected block size: 2; got: 1 I/ExoPlayerImpl(21797): Release 54b86c [ExoPlayerLib/2.18.7] [Infinix-X670, Infinix X670, INFINIX, 33] [goog.exo.core, goog.exo.exoplayer, goog.exo.decoder, goog.exo.datasource, goog.exo.extractor]

loonix commented 2 weeks ago

that's great that you found a bug, but try to give more information like, what device you had the problem, what were you doing, an example of your implementation... doesn;t need to be all fancy but at least try to make a bug report as if you as an outside person can try to reproduce it.

AwaisQazii commented 2 weeks ago

yeah sure @loonix, in my case if I record with WAV format then no audio player including just_audio package is able to identify as correct source of file.

I have resolved this by doing this in file (WavRecordThread.java)

   header[32] = (byte) ((channels * (int) RECORDER_BPP) >>  3);
    header[33] = (byte) ((channels * (int) RECORDER_BPP) >>  11);

with help of @dignaristeve 's reply from here https://github.com/rmbrone/flutter_audio_recorder/issues/11#issuecomment-654289094