Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio files recorded by the record plugin are incorrectly saved without duration value #306

Closed
kupriev opened this issue Apr 25, 2024 · 3 comments

Comments

@kupriev
Copy link

kupriev commented Apr 25, 2024

record: ^5.0.1

Environment
Android 10

Describe the bug
When recording a file on Android devices from Xiaomi Redmi 7A, the playback duration is not saved. This issue seems to be vendor-dependent. For example, on other devices, audio files are recorded correctly, but if an audio file is recorded on a Xiaomi Redmi 7A device, it can only be played back on that same device and nowhere else.

The file recorded using the plugin on Xiaomi:
https://github.com/llfbandit/record/assets/168094973/3ab29449-390b-41da-9ba5-21e64da5e876

Additional context
Media info of the file recorded by the plugin on a Xiaomi device:

General
Complete name : b537f350-3fc2-1f91-8ee5-d1868367250a.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42 (isom/mp42)
File size : 39.8 KiB
Overall bit rate mode : Constant
Encoded date : 2024-04-25 10:14:55 UTC
Tagged date : 2024-04-25 10:14:55 UTC
com.android.version : 10

Audio
ID : 1
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : 2 / 2 / 40 / mp4a-40-2-2
Bit rate mode : Constant
Nominal bit rate : 128 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 44.1 kHz
Frame rate : 43.066 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 36.6 KiB (92%) / 36.6 KiB (92%) / 36.6 KiB (92%)
Title : SoundHandle
Language : English
Encoded date : 2024-04-25 10:14:55 UTC
Tagged date : 2024-04-25 10:14:55 UTC

Flutter doctor command
[✓] Flutter (Channel stable, 3.16.9, on macOS 14.0 23A344 darwin-arm64, locale ru-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.87.2)
[✓] Connected device (4 available)
[✓] Network resources

@llfbandit
Copy link
Owner

Yes there was a similar issue about this #253.
I asked if it was resolved but nobody answered.

At this time, it should be resolved (or at least improved) in record_android: 1.1.0. Please ensure you updated record package to 5.0.5 version.

From here, if this is not resolved there's not many ways to solve to this. I use what the SDK provides nothing else. The only other solution I see is to re-implement "basic" recording with MediaRecorder. v5 uses media codecs to provide additional features.
But this is far from a guarantee either...

@llfbandit
Copy link
Owner

llfbandit commented May 21, 2024

Should be fixed in next record_android: 1.2.0. At worst, you can use the legacy recorder shipped in the same version.

@shichunlei
Copy link

I still have this problem in record: ^5.1.0. How did you solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants