Closed arreshashikant closed 6 months ago
Same problem
I'm having the same issue too... hopefully, it can be fixed soon...
Released in record_android 1.0.4.
Sorry, this issue was closed for no reason...
Still have a problem with zero record duration, record_android 1.04
This issue is very unclear to me. I don't reproduce any issue with the duration.
@arreshashikant Your reproducer is wrongly set, this is not how audioplayers
works. You must rely on streams to get your info.
I updated the example in the repository to show the audio duration before playing it.
If other participants have more or other info to share, it is time before I close this.
I agree that we should rely on streams to get duration. But,
There's no issue with player when AudioPlayer.getDuration()
call is made after setSource
future is complete.
This issue is very unclear to me. I don't reproduce any issue with the duration. @arreshashikant Your reproducer is wrongly set, this is not how
audioplayers
works. You must rely on streams to get your info.I updated the example in the repository to show the audio duration before playing it.
If other participants have more or other info to share, it is time before I close this.
When compile and build your example I've got duration 00:00:00.023 on Android real device in any way. But when I run this example on iPhone - duration is correct. Also, all audio recorded using iPhone had correct duration when playing in Android and all audio recorded in Android has near-the-zero duration in iPhone. Another example, when I send recorded audio by your example to the Telegram, if audio from iPhone - it has correct duration, when I send recorded audio from Android - duration showed zero.
Flutter (Channel stable, 3.16.5, on macOS 13.6.1 22G313 darwin-x64)
Problem only with codecs aacLc, aacEld, aacHe Opus on Android work well
Plugin output:
I/MediaCodec(11566): Codec shutdown complete W/MPEG4Writer(11566): 0-duration samples found: 117 I/MPEG4Writer(11566): Received total/0-length (118/0) buffers and encoded 118 frames. - Audio I/MPEG4Writer(11566): Audio track drift time: 0 us I/MPEG4Writer(11566): Normal stop process D/MPEG4Writer(11566): Audio track stopping. Stop source D/MPEG4Writer(11566): Audio track source stopping D/MPEG4Writer(11566): Audio track source stopped D/MPEG4Writer(11566): Audio track stopped. Stop source D/MPEG4Writer(11566): Stopping writer thread D/MPEG4Writer(11566): 0 chunks are written in the last batch D/MPEG4Writer(11566): Writer thread stopped I/MPEG4Writer(11566): The mp4 file will not be streamable. D/MPEG4Writer(11566): Audio track stopping. Stop source
I have the same issue.
We had similar issue with player new version 5.0.x everyting is perfect 4.4.4 however, when we updated to 5.0.x there was unstable problem. although records can listen on the recorded phone. they were not working other devices. An Example, recorder settings screenshot
We used ai to compare working and notworking voice record.
The problem was on the bitrate.
Summary, records on the android was problematic.
file extension was .m4a
We had similar issue with player new version 5.0.x everyting is perfect 4.4.4 however, when we updated to 5.0.x there was unstable problem. although records can listen on the recorded phone. they were not working other devices. An Example, recorder settings screenshot
We used ai to compare working and notworking voice record.
The problem was on the bitrate.
Summary, records on the android was problematic. file extension was .m4a
Did you find a Solution?
I have an issue where files recorded on Android don't have an extension but can be listened on the device it was recorded but not on iOS
We had similar issue with player new version 5.0.x everyting is perfect 4.4.4 however, when we updated to 5.0.x there was unstable problem. although records can listen on the recorded phone. they were not working other devices. An Example, recorder settings screenshot We used ai to compare working and notworking voice record. The problem was on the bitrate. Summary, records on the android was problematic. file extension was .m4a
Did you find a Solution?
I have an issue where files recorded on Android don't have an extension but can be listened on the device it was recorded but not on iOS
version 4.4.4.
@llfbandit This is a major issue as it's linked to the default settings of the RecordConfig(). Android files are corrupted and unreadable from the backend.
I can't reproduce this issue with the two devices I own.
Here's what I get when using default settings. This is perfectly fine (at least it seems).
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42 (isom/mp42)
File size : 54.3 KiB
Duration : 3 s 251 ms
Overall bit rate mode : Constant
Overall bit rate : 137 kb/s
Encoded date : 2024-02-20 17:28:29 UTC
Tagged date : 2024-02-20 17:28:29 UTC
com.android.version : 14
Audio
ID : 1
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : mp4a-40-2
Duration : 3 s 251 ms
Source duration : 3 s 274 ms
Bit rate mode : Constant
Bit rate : 128 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 44.1 kHz
Can someone send me audio files for comparison?
@llfbandit
The Android file get recognized as a Video file. Perhaps that's why it's unreadable with an audio decoder
Try using the android Emulator to reproduce the issue.
Please, send me the files.
To whomever is using this package and audioplayers
while fetching data from Firebase Storage. I was able to fix this issue in ^5.0.4
by passing the metadata manually with the file because, for some unknown reason, Firebase is not able to understand the file format of the Android Encoded file and without a File extension, the files are unreadable on iOS. (See Troubleshoot)
@llfbandit I have an example file here: https://drive.google.com/file/d/1Upa2y9py4yeOgzehWXl1jzCZa0gu9pkV/view?usp=sharing
Could someone test with current code of record_android
on git?
I still have this problem in record: ^5.1.0. How did you solve it?
Hi everyone, I'm still using record 4.4.4 because of the problem on this issue.
Is there any garantee for the 5.1.1
Because of the recording our app main feature, I cannot get risk to update package version. However, I need to update record with new flutter version requirement and dependencies
@Shawn-sudo , @shichunlei , @llfbandit and @blok5025 can you share how is going on last version of the record package 5.1.2 ? i need to update my package 4.4.4 to 5.1.2
Package version record: ^5.0.1
Environment
Describe the bug
Recording works fine. But, when we try to get the duration of recorded file (either through ffmpeg or audioplayers plugin), it returns Zero Duration.
RecordConfig - Default
To Reproduce
Steps to reproduce the behavior: Sample repository - https://github.com/arreshashikant/buggy_repo/tree/recordDurationZero branch -
recordDurationZero
Expected behavior Return valid duration of the recorded file
Additional context The recorded bytes returns valid duration if we start recording with
startStream