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
Operationg multiple flutter_sound instance independently #232
Comments
I really think that flutter_sound should be re-entrant (can play or record several audios sessions independently). Not sure that this point will be a priority, and unfortunately we do not have plenty of time. |
I also think this usage is some kind of unexpected and "unsophisticated" 😑... In any case, I'm little bit confused by this behavior that the "instance I operate" and "actually operated instance" are not linked:confused:. Thank you for your opinion and contribution @Larpoux 😄. (and also all contributors👍) |
The new flutter_sound version has two different modules:
Those two modules are completely separated. This has two benefits:
My project would be to split again the legacy
For having backward compatibility, the Then, we will have three modules :
Then, I think it will be easier to address #232 (which has been closed by its creator, but for me this issue is still valid and interesting). |
PR #257 is a major re-design of flutter_sound architecture.
Complete backward compatibility is provided by two deprecated modules :
@kiha-la : This PR is still in beta-version, and is still not merged in Flutter-Sound Master branch. |
Version of flutter_sound
flutter_sound: ^2.0.4
flutter doctor
[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.17763.1039], locale ja-JP)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Android Studio (version 3.6)
[√] VS Code, 64-bit edition (version 1.42.1)
[√] Connected device (1 available)
Platforms you faced the error (IOS or Android or both?)
Tested on Android
Expected behavior
onRecorderDbPeakChanged
callback within the multipleFlutterSound
instances.Actual behavior
onRecorderDbPeakChanged
for allFlutterSound
instances.Tested environment (Emulator? Real Device?)
Steps to reproduce the behavior
l.29 Declare two instances with
FlutterSound
member.flutterSound.setDbLevelEnabled(false)
, another isflutterSound.setDbLevelEnabled(true)
.l.39 Execute
flutterSound.startRecorder
against both instance.setDbLevelEnabled(false)
one' -> 'setDbLevelEnabled(true)
one' .Result of two
onRecorderDbPeakChanged
callback are shown.l.57 Call
flutterSound.stopRecorder()
of the dBLevel Disabled instance.flutterSound.stopRecorder()
of the dBLevel Enabled instance is called.FlutterSound
is overwritten?Exception has occurred due to _recorderSubscription of the dBLevel Enabled instance called against null recorder.
It seems that
onRecorderDbPeakChanged
is excused against allFlutterSound
instances, because of_dbPeakController
is static. I avoid this problem by changing_dbPeakController
to non-static (I'm not sure this solution is safe or not... ). However I have not resolved 'recorder overwritten problem' yet.Is there any reason
FlutterSound
does not support the multiple audio recording?The text was updated successfully, but these errors were encountered: