Need help with connecting the following with the corresponding sounds

Here is the aia file attached. When I click on the images, the corresponding sounds should play. The sounds can be stored in a list parallelly. How do I proceed...
MemoryGameSound.aia (502.5 KB)

  • you need a List of your sounds (which presently does not exist in your shared code) Presently you only have meow

  • you may be able to use a List of Pairs to provide a correspondence between your image files and sound files. Like cat.jpg .. meow.mp3

  • with your existing scheme you will need to have a set of if..then..else statements so that when two tiles match then your app plays a sound. Like if match then if match = cat.jpg
    then play meow.mp3. Or if the Button is touched you play the corresponding sound regardless of a match. What you code depends on what you want to happen.

Here is the easy part to code. :slightly_smiling_face: that executes whenever there is NO match

buttonSound

Here is the the code model to play sound when a match:

Add more sounds and it should work for you :wink: Does it work?

Here's a working sample in the Gallery, that corrects your match response code.
https://gallery.appinventor.mit.edu/?galleryid=5364471291838464
but does not add sounds.

Hi sir, I have the same problem. But my app is matching type animal sound. When i click the reset button the image of the animals is shuffling but the sound of the animals is NOT shuffling. So like for example when i click the cat and it matches the same picture is sounds like other animals . Can you help me sir ?

My problem sir is how to add the sound in each corresponding images of the animals and if you click the reset button and matches the animals, the sounds of each animals matches also. Can you help me with that sir ?

You have already been given the solution in the other thread. Combine your images and sounds to one list of lists. Then they will shuffle / unshuffle together. Use the list blocks to make your selections.

1 Like

Sir i will to your email my app if its okay with you for you to see the problem what am i need to fix . Please sir