I want to make an app that has buttons that when pressed, plays a sound. How would I add the sounds, and then use the Line thing in IB to connect them to a button?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It sounds like you’re fairly new to this, so I would suggest you start with a simple example like this:
http://www.youtube.com/watch?v=47c1dIN5NgQ
Once you get a little more advanced, you can setup an array of either UIButtons or UIImages on a view (or scrollview) and play sounds based on their tag or some name in array. Or you can stick with the simple method of just laying out UIButtons on a view and hooking up each individually to a specific sound.
There are plenty of tutorials though, so just search for “playing sounds with avaudioplayer” on google or here on stackoverflow