alnitak / flutter_soloud

Flutter low-level audio plugin using SoLoud C++ library and FFI
MIT License
156 stars 15 forks source link

fix: Missing audio on playing a loaded url #80

Open chotixity opened 2 months ago

chotixity commented 2 months ago

Description

A clear and concise description of what the bug is.

Steps To Reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected Behavior

A clear and concise description of what you expected to happen.

Screenshots image

If applicable, add screenshots to help explain your problem.

Additional Context

Add any other context about the problem here. I am loading a url from firebase(printed in the above screenshot then calling play on the fetched url but there is no sound. Here is the exception.

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 'package:flutter_soloud/src/soloud.dart': Failed assertion: line 579 pos 11: '_activeSounds E/flutter ( 5630): .where((sound) => sound.soundHash == ret.sound!.soundHash) E/flutter ( 5630): .length == E/flutter ( 5630): 1': Sound is already loaded but missing from _activeSounds. This is probably a bug in flutter_soloud, please file.

alnitak commented 2 months ago

Hi @chotixity,

I never tried to use FireBase with SoLoud.instance.loadUrl(). It would be nice to see some relevant code you used.

That error could occur if the same url is used more than once when calling the above loadUrl within about 10ms. Maybe you called it while FireBase was getting chunks of the mp3 file?