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

stop() not working with loadAndPlayUri and loadAndPlayUint8List #119

Open
dvagala opened this issue Jul 22, 2023 · 2 comments
Open

stop() not working with loadAndPlayUri and loadAndPlayUint8List #119

dvagala opened this issue Jul 22, 2023 · 2 comments

Comments

@dvagala
Copy link

dvagala commented Jul 22, 2023

Hello, thank you for this great package!

I found an issue. The soundpool.stop() is not always working when loading from file. It occurred on iOS, I didn't test Android.

Here's minimal reproducible code:

        int _streamId;

        _streamId = await _soundpool.loadAndPlayUri(file.uri.toString());
        // stop not working
        await _soundpool.stop(_streamId);


        _streamId = await _soundpool.loadAndPlayUint8List(file.readAsBytesSync());
        // stop not working
        await _soundpool.stop(_streamId);


        _streamId = await _soundpool.play(
          await _soundpool.load(
            file.readAsBytesSync().buffer.asByteData(),
          ),
        );
        // stop working
        await _soundpool.stop(_streamId);

Soundpool 2.3.0
Flutter 3.10.5
iOS 16.1

@novas1r1
Copy link

novas1r1 commented May 1, 2024

@dvagala have you found a solution to that? I'm having the same issue with flutter 3.19.5, ios 17.4 and soundpool 2.4.1

@dvagala
Copy link
Author

dvagala commented May 1, 2024

@novas1r1 It was quite a time ago, but I think I just used that last approach from the reproducible code above

   _streamId = await _soundpool.play(
          await _soundpool.load(
            file.readAsBytesSync().buffer.asByteData(),
          ),
        );
        // stop working
        await _soundpool.stop(_streamId);

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

2 participants