You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems to be related to the StreamController I wrongly used here
When you switch from "waveforms" tab to the "Hello World!", that stream is still active and when it receives a new event, it will try to call SoloudTools.initSounds() which throws that exception!
If you start with the "Hello World!" (initialIndex: 0), this doesn't happen.
So, there are 2 fixes to think about:
check if the engine is started in SoloudTools.initSounds()
find a better way to expose SoLoud().audioEvent stream. Now it is set as a broadcast inside a singleton class. Is it worth considering moving the event stream flow to a dedicated class? Now the developer can subscribe to it (like I did wrongly) and then he needs to remove that subscription, which is not possible IIRC with a broadcast.
For now I will correct the error in the example, then maybe we should open a new issue
FWIW, I think you can cancel a broadcast stream subscription. But yeah, broadcast streams are a bit of a minefield.
I'll open a new issue that addresses the audioEvent / singleton issue more generally.
Here, apart from fixing the bug in the example, I'd like to make sure that if such a problem is encountered, we don't crash. Not from C++ land. I'd just throw a (Dart) exception instead, or something.
Description
When trying to open a bad mp3 file, the app crashes (no exception — just immediate crash).
Steps To Reproduce
.mp3
.flutter_soloud
example appExpected Behavior
An exception is thrown (or some kind of
FlutterErrors
thing is returned).Screenshots
Additional Context
Full crash info
The text was updated successfully, but these errors were encountered: