Play two Different sounds simultaneously using single sound component

I made an musical instrument app. Now the problem is like i made piano app and now i want to play more then 1 button simultaneously to play sound on both buttons. Now the problem is i am using single audio component. How can it will be possible to do that with single audio component ?

Suppose u want to play different audio on 2 button using single audio component simultaneously ? Is that possible ? How to do that

It will be possible if i use each audio component for each button but i can’t do that bcoz there will be 100 of audio component in my app and the app will crash.

Any solution for this issue ?

What exactly is the goal? I think you will certainly not want to play more than 3 audio files at the same time. So you only need 3 Player components and only need to change Player.Source each time.

I also have dozens of audio files in some of my apps, of which I play 3 simultaneously (voice, music and nature sounds).

However, if you actually want to play many audio files at the same time, which components or extensions (Player, ExoPlayer, TaifunPlayer) have you tried?

I use sound components, as it gave fast result in playing the sound again and again without any issue

But yeahh 3 will be enough but how to do that means how to set the blocks ?

Suppose i set
sound component 1 for button 1
sound component 2 for button 2,
sound component 3 for button 3,
sound component 1 for button 4,
sound component 2 for button 5,
sound component 3 for button 6,

Then if someone play button 1 & button 4 simultaneously, it won’t play.

Please tell me how to set like automatical arrangements of sound component for all buttons

I still don’t understand the goal. Create a simple test aia and explain exactly what should happen and when. Which sounds should be played when and after which action at the same time?

Here is the aia demo file you asked for @bodymindpower -
Test_Piano.aia (634.1 KB)

Now i want to play 2/3 button sound simultaneously

I used 3 Sound components to even play 3 sounds simultaneously.
Try this: Test_Piano.apk (5.8 MB)

This should also work if there are hundreds of sounds, of which a maximum of 3 sounds should be played at the same time.

wow great job @bodymindpower thanks a lot now please provide me the aia file.

One more thing is that possible to play the buttons by sliding the finger from right to left or vice versa ? Like in real piano ?

Btw you are a true genius thanks

I think my logic is quite simple. Try to click all buttons (1, 2, …, 12) one after the other and you will understand the logic. So try it yourself.

This shouldn’t be possible with buttons. For this you have to e.g. use a Slider or something else.

1 Like

Okay i will try, if even after try i didn’t get one, will ask u for the aia. Thanks

But you can’t make a piano app using slider right and btw what something else u r indicating about?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.