App Development using MIT APP Inventor Platform
All tutorialsHomepage
  • πŸ“±Mobile App Development using MIT APP Inventor Platform
  • 🐭User Interface and User Experience
  • πŸ”Setup
  • πŸ¦‘MIT App Inventor Interface
  • πŸ˜ƒTutorial#1: Image Hide-and-Seek
    • Building your First Mobile App: App Design
    • Building your First Mobile App: App Logic
    • Testing the app
      • Testing the app using USB
    • Extension activity 1: Improving button stability
    • Extension activity 2: Adding sound asset to the app
    • Final Remarks
  • πŸ—ΊοΈTutorial#2: Creating a multi-screen SOS App
Powered by GitBook
On this page

Was this helpful?

  1. Tutorial#1: Image Hide-and-Seek

Extension activity 2: Adding sound asset to the app

PreviousExtension activity 1: Improving button stabilityNextFinal Remarks

Last updated 1 year ago

Was this helpful?

For an additional enhancement, let's integrate a sound asset into the app. Follow these straightforward steps to incorporate a sound file along with the button component.

  1. Navigate to the left panel (Panel 1) and click on the Media tab. Drag and drop the Sound component onto the screen. Note that the sound component is non-visible, so you won't see any changes on the screen.

  2. Upload a WAV sound file, similar to how you uploaded the image file.

    Locate the sound file (switch-1.wav) within the Media folder.

  3. Click on Sound1 in the Components tree. From the Properties panel, select the uploaded sound file as the Source.

  4. Switch to the Blocks tab and click on Sound1. Drag the call Sound1.Play block.

  5. Move the Play block inside both the if and else parts of the existing code. The final code should resemble the image below:

All done!!!

πŸ˜ƒ
Final code block