cassette icon indicating copy to clipboard operation
cassette copied to clipboard

Sound works ~14 times and then stops working

Open Fuadex opened this issue 6 years ago • 8 comments

Hi man, awesome job with the library, it seems like it is the only one that actually does work with android and it's exciting to see possible manipulations with music via processing on android.

Nevertheless, there is some sort of a glitch that prevents the music from playing once it gets repeated, in my case around 14 times. I saw someone having the same issue on the processing forum: https://forum.processing.org/two/discussion/19302/using-android-mediaplayer-to-play-sound Although in that case it was 7 times.

May I ask whether you would know where does the error come from or whether it is easy to fix? As processing does not throw any error whatsoever which seems suspicious.

Once again, thanks mate for your great work!

Fuadex avatar May 25 '18 06:05 Fuadex

Hello ! The exactly same thing is happening to me

jpupper avatar Jun 30 '18 18:06 jpupper

(Using Processing for Android, similair to Java) It only works 1 time for me if I load the SoundFile in setup. It works exactly 14 times if I load the SoundFile right before I play the sound.

This indeed only seems like the only library that works on Android, I've tried many. It would be great if you could fix it!

sjoerd1999 avatar Jul 01 '18 15:07 sjoerd1999

Also, it doesn't matter if you use different files. There's a maximum of 14 playbacks. If you have 2 files, it doesn't go to 28.

sjoerd1999 avatar Jul 01 '18 15:07 sjoerd1999

code is something like:

music.play(); if(mousePressed) music.stop();'

And repeating that( of course only executing play() and stop() once, only when state changes)

sjoerd1999 avatar Jul 01 '18 16:07 sjoerd1999

So, i´ve decided to change library for playing sounds in processing for android.

This thread give me the solution : https://discourse.processing.org/t/a-working-sound-playing-app-sketch-works-as-of-may-27-2018/451/18

jpupper avatar Jul 02 '18 21:07 jpupper

If I load the resource again, it is limited to 14 plays. If I don't load the resource again, it is limited to 1 play.

So that solution doesn't work

sjoerd1999 avatar Jul 04 '18 13:07 sjoerd1999

But yeah, MediaPlayer might work better. It's a lot more complicated though, so it would be nice if this library gets fixed, because of it's simplicity

sjoerd1999 avatar Jul 04 '18 13:07 sjoerd1999

@Aurelian24 Does this solution work for Android as well? Seems like it, looking forward to trying it out :)

In case of this library: I somehow managed to stuff three tracks into an app and miraculously the sounds would not crash. But if I changed the sounds to some other configuration with the same names or even the same sounds but converted differently, the sounds would... crash.

I have no idea what's the root of the problem but that must be an eerie one.

Fuadex avatar Jul 05 '18 02:07 Fuadex