Sound Player Doesn't work properly

I have created a virtual instrument app, in which there are guitar player, piano, tabla and drum but when i play single instrument on single screen it work fine but when i try to play more then 3 instruments, the sound play stop working there is a bug i think so. I am attaching the aia to experience is bug.

Just post an image of your blocks.

2 Likes

Screenshot 1
I had used all button for sound like this

Screenshot 2 Screenshot 3 Screenshot 4

These are screen shot of tabla player, but when i try play tabla then another piano then guitar, the sound player stop working

Which Sound.MinimumInterval did you set? And post the blocks in good quality.
See here (→ point 3):

1 Like

In your first screen I can see that you use only 1 soundplayer1 with different sources. You should use different Soundplayer instances for different sounds.

2 Likes

I apologies for the one, i did take the screenshot from snipping tool don’t know how it lowered the quality. The Sound.MinimumInterval is set to 100 ms.
Sorry for late reply

Because there are many sound and so if you use more then 15 sound player and then play it one by one, then there comes a bug and all sound stop working.

In my soundpad i am using 36 Player instances and it is working good. Maybe you should try the player component instead of sound component

2 Likes

You are using single player for single sound ? how is that possible because i had tried this and get an error. the sound doesn’t work if i play all one by one. But if you are saying i will try it one more time and send you apk if I suffered from the same old issue.

1 Like

Your blocks seem fine. Make a short video that shows when and where exactly which problem arises.

2 Likes

Please watch the video to know the exact issue i am facing

1 Like

The problem arises, as almost always in such cases, when screens are opened multiple times. This leads to a memory issue.

See e.g. here:

2 Likes

First: thx for the video. Now I understand. I thought you wanted to play several notes at the same time. For that you would need a player for each sound.
Follow @bodymindpower 's advise. As described in her link It is very important to close the current Screen when you switch to another.

1 Like

Now it work fine, thank you so much for solving the issue you are a true genius.

There is one more issue when you upload your app as .aab ( App bundle ) in google play store and try to play sound component, its shows the sound file is missing.

1 Like

Thanks you so much

See here:

So if i use Exoplayer instead of Sound Player then it will work fine ?

Yes, as already said, when I released the internal test track, it worked with the ExoPlayer, so just check it with an internal test track and report here.

1 Like

Okay will try that and thanks a lot