Making a sound When we fire a bullet, we will play a sound The AVFoundation framework enables us to add sounds to our app.

Slides:



Advertisements
Similar presentations
Personal Development Module - demo no limits to success.
Advertisements

Microsoft® Small Basic
Using the SmartPLS Software
David Meredith Minim David Meredith
Audacity: a step-by-step tutorial Presented by: Terry W. Hoffland.
Name Matrix No CHIA EE LOON(LEADER) OW CHEE YEE LAURA TIONG UNG KAH CAT200 Integrated Software Development Workshop Storyboard.
IOS and AddressBook CS4521. Address Book UI Framework Exploring Contacts.
Group 8: Dylan Lentini (AE), Mandy Minuti (WSE), Jean Paul Galea (TL)
User Guide and Trouble-shooting Information. A classroom set of 20 cameras are available for teacher and student use. Capable of taking video, but recommend.
HOW TO ADD AUDIO & VIDEO MRS. CRIDER PIT AUDIO Click on the insert tab Choose the Audio button and select Audio from file option Navigate to your folder.
Smartphone Apps Development Team Weiqing Li Lijun Zhu Man Li.
PRIMARY, SECONDARY & QUANTITATIVE RESEARCH TASK HYPERLINK APPLICATION PROCEDURE 1.
Instructions 1. Open xCode 2. File -> New Project 3. Start a new View based iPhone Project. The type of project you create really.
Jacqueline A. Gill, Associate Professor PowerPoint 101 CREATING POWERPOINT TUTORIALS FOR BI CITY COLLEGE LIBRARIES.
BoardMaker Ver 6 Creating Interactive Activities for the Classroom.
© 2010 IBM Corporation IBM Experience Modeler - Theme Editor Installing Python Image Library Presenter’s Name - Presenter’s Title DD Month Year.
ImageJ Tutorial.
AD 206 Intermediate CG : School of Art and Design : University of Illinois at Chicago : Spring 2009 Intro to Action Script 9 "The games of a people reveal.
Ontario Public Library Guidelines, Section QR Codes.
CISC 673 : Optimizing Compilers Dept of Computer & Information Sciences University of Delaware JikesRVM.
Computer Programming For Musical Applications II Tutorial 08 Recording in SuperCollider 21st November, 2008.
LEGO NXT Robot Programming Introduction to Programming a Lego NXT robot in Java.
Using Data Active Server Pages Objectives In this chapter, you will: Learn about variables and constants Explore application and session variables Learn.
Sprite Animation CSE 391 Fall 2012 Tony Scarlatos.
Simple Game Animation – iPhone Programming Exercise 3 CSE 391 Fall 2012 Tony Scarlatos.
Xcode Presentation Tom Pletzke. Creating App from template Launch Xcode Select Tabbed Application.
PARSING FACEBOOK DATA FOR ANDROID 1. Step by Step  Import Android SDK  Get the hash key  Create a new app  Create a new project in Eclipse 
Introduction to Android. Android as a system, is a java based operating system that runs on the Linux kernel. The system is very lightweight and full.
London April 2005 London April 2005 Creating Eyeblaster Ads The Rich Media Platform The Rich Media Platform Eyeblaster.
Creating Buttons – Lesson 71 Creating Buttons Lesson 7.
Tabbed Views UITabBarController. Controller Architecture UITabBarController Controls the first view that the user sees The view controller class (and.
Proposed Debugger Features Ken Ryall Warren Paul.
Create a Web View App Step-by-Step. Step 1 Create a new project in XCode using the "Single View Application" option.
+ An Intro To Xcode By Sarah Montroy. + What is Xcode?
CSci 111 – computer Science I Fall 2014 Cynthia Zickos WRITING A SIMPLE PROGRAM IN JAVA.
How to make and publish a web page. Create a folder.
Introduction to Objective-C and Xcode (Part 5) FA 175 Intro to Mobile App Development.
 Facebook Integration on iOS Phan Thanh Phat Huynh Thanh Van.
Course Summary Xcode & iPhone Simulator
Audio Yu Feng CGDD Review 1. Set up 2. IOS sound – Core Audio – Short Sound – Long Sound – Control Sound – Background Sound 3.Cocos2d sound.
Sounds, Images, and Text FA 172 Intro to Mobile App Development.
No movie would be complete without opening titles, captions and closing credits. In the Title Step, you can create animated text titles or choose from.
line.net/ okpop.com/bar elythereflashin dex.html.
Persistence CS 344 Mobile App Development Robert Muller.
Save this file to your Apps Folder as YourLastName_PP3.
introductory lecture on java programming
Click the I Pro and select MANAGE and the PROJECTS. This will allow you to set up a folder that will contain the files for your current project. If you.
Basic ActionScript and PHP Cis 126. Getting Started set up a basic folder structure so we can keep our files organized. Mirror this structure on your.
FYP Presentation Using Mobile Sensors for Wireless Home Security System Author:Student ID: Sun Chak Fong, Cheung Ngai.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
Adding Sounds Games Programming in Scratch. Games Programming in Scratch L6 Adding Sounds Learning Objectives Learn how to add sound to a Scratch game.
Creating Web Pages with Links, Images, and Embedded Style Sheets
Screens naming screens and concepts v2.8 Disclaimer: This document is provided “as-is”. Information and views expressed in this document, including URL.
The Alfresco iOS SDK Gi Lee (Zia Consulting) Peter Schmidt (Alfresco)
 CSC 215 : Procedural Programming with C C Compilers.
WebViews UIWebView. Controller Architecture UITabBarController Controls the first view that the user sees The view controller class (and xib) that manages.
Lec 12 Pickers CS 3800 Introduction to IOS programming Lecture 12 Summer 2011.
Media Library Sisoft Technologies Pvt Ltd
הצטרפות לקבוצת DeDemoc
EEC-492/693/793 iPhone Application Development
Testing REST IPA using POSTMAN
EEC-492/693/793 iPhone Application Development
Application Prefetch Files Prefetch Files
Variables and Their scope
File Upload.
Social Media And Global Computing Creating DLLs with Visual Studio
Entity Framework Code-First Migrations
Carthage ios 8 onwards Dependency manager that streamlines the process of integrating the libraries into the project.
Fast-Track UiPath Developer Module 2: Getting to Know UiPath Studio
4.4 – List vs Array Exercise 4.1: Array Variables
Presentation transcript:

Making a sound When we fire a bullet, we will play a sound The AVFoundation framework enables us to add sounds to our app

AVFoundation framework We need to import that framework into our project (it is not in the frameworks folder) In Project Navigator, select Build Phases tab, Select Link Binary With Libraries, +, choose AVFoundation Framework It shows up in the frameworks folder

AVFoundation framework #import We will use the AVAudioPlayer class It encapsulates a sound: it enables us to play a sound, stop playing the sound, set the volume,.. Note: need to import the sound into the resources folder

.h file Add an AVAudioPlayer instance variable AVAudioPlayer *cannonFireSound; In the.m file, we need to find this sound file, allocate memory for and initialize the object above

.m file Inside initWithFrame method The method initWithContentsOfURL, from class AVAudioPlayer, takes a NSURL argument representing the url path of the sound file From a string representing a regular file path, we can build a NSURL object

.m file Get File path NSString *soundPath = [[NSBundle mainBundle] Build NSURL object NSURL *fileURL = [[NSURL alloc] initFileURLWithPath:soundPath];

.m file Allocate memory and initialize hitPlayer cannonFireSound = [[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:nil]; Now we can set the volume, play the sound, pause, stop,.. More at developer.apple…. cannonFireSound.volume = 0.9; // between 0 and 1 [cannonFireSound play];

.m file We used the alloc method to allocate memory for and create the fileURL object In previous versions of Xcode only (but not with Xcode 5)  we own that object, we are responsible for releasing it [fileURL release];

AVAudioPlayer There may be a lag the first time you play a sound  preload the sound using the prepareToPlay method [cannonFireSound prepareToPlay];

Making a sound when cannon is fired When do we fire the cannon? The cannon will fire based on user double tapping We need to add some code to the processTouch method and capture a double tap

Making a sound when cannon is fired Cannon is fired on a double tap by the user In processTouch method if( touch.tapCount == 2 ) [cannonFireSound play];