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

repeat not work #97

Open
ash0080 opened this issue Apr 1, 2022 · 6 comments
Open

repeat not work #97

ash0080 opened this issue Apr 1, 2022 · 6 comments

Comments

@ash0080
Copy link

ash0080 commented Apr 1, 2022

iOS / macOS
version 2.3.0

No matter how many repeat settings are set, it will only play once
Because of a bug, I haven't been able to test it on Android

@pitazzo
Copy link

pitazzo commented Apr 19, 2022

Same problem here, I can confirm the issue does not happen in Android devices

@ash0080
Copy link
Author

ash0080 commented Apr 20, 2022

Same problem here, I can confirm the issue does not happen in Android devices

I switched to audioplayers

@eximius313
Copy link

I have a question:
Specification of SoundPool states:

Sounds can be looped by setting a non-zero loop value. A value of -1 causes the sound to loop forever. In this case, the application must explicitly call the stop() function to stop the sound. Any other non-zero value will cause the sound to repeat the specified number of times, e.g. a value of 3 causes the sound to play a total of 4 times.

but in the code there is:

assert(soundId > -1,
        "Invalid 'soundId' parameter. Only values greater than -1 are valid.");

Should't it handle >=-1
?

@eximius313
Copy link

There is also setLoop API, but unfortunatelly it's not implemented here ;(

@ukasz123
Copy link
Owner

ukasz123 commented Oct 2, 2023

I have a question: Specification of SoundPool states:

Sounds can be looped by setting a non-zero loop value. A value of -1 causes the sound to loop forever. In this case, the application must explicitly call the stop() function to stop the sound. Any other non-zero value will cause the sound to repeat the specified number of times, e.g. a value of 3 causes the sound to play a total of 4 times.

but in the code there is:

assert(soundId > -1,
        "Invalid 'soundId' parameter. Only values greater than -1 are valid.");

Should't it handle >=-1 ?

soundId is a key to decoded sound content in the storage not number of repeats.
The number of loops is passed directly to play method here as repeat variable.

@eximius313
Copy link

@ukasz123, oh, you're right. I've mistaken soundId with repeat :D

but setLoop is not implemented, right?

It would be also great if you add -1 as infinite into the documentation :)

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

4 participants