2014년 12월 4일 목요일

How can I change the image of a button when clicking it and play a sound?

Hi all, I´m new to app inventor. I need some help for a school project. The whole project consists in making an image say something random every time you tap it. However, I want the image to change when it`s tapped and play a sound according to the image that appeared. I would appreciate some help here. Additional information: I just have 2 days to finish this project.



What have you tried so far?



I tried some blocks at the "logic" section but they don´t play the sound. And I`m not sure if the "join" block of the text section will work



You'll have to make a list of text and images.  When you tap, you change the image and the text.

Sounds to me like you procrastinated on this project for school, and are now cramming to get it done!

First, have you done ANY of the tutorials?  The tutorials are located here: http://appinventor.mit.edu/explore/ai2/tutorials.

You probably want to use text-to-speech to "say" the text, and just load the image to the button.



Thanks for the tip. Yes, I already did some tutorials. I would ask for a complete "tour" if I hand`t checked them. May sound like too much for just a school project, but one of the things graded will be how complex the app is. I would prefer to use my own voice for this.



If you're going to use your own voice, you'll have to record the sounds, and then add them to the project as media.  However, you have a 5MB cap so your samples should be the simplest, low level quality if you plan to have many.  I suggest you read my tips below because you'll run into problems if your stuff is too large.  Also, you'll need to use the Sound component to play the text recordings, as long as they're short.



That`s already done. The lines are already recorded, short and have low quality. They are also imported and set as sounds. The same goes for the images. I only need help at the "blocks" part.



I don't understand where you're lost... Button.Click.  Change Image, Play Sound



Thank you so much for that. Now I just need to find a way to make it pick from a random list. There are 6 different image. Each one has an own sound.


댓글 없음:

댓글 쓰기