Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 12-25-2009, 04:49 PM   #1 (permalink)
ColouredRobot
College Student
 
ColouredRobot's Avatar
 
Join Date: Dec 2009
Location: Los Angeles, CA
Posts: 75
ColouredRobot is on a distinguished road
Exclamation Playing Audio when App Launches

I was wondering what was the best way to play audio at the beginning of the app, without having any build errors or warnings.

The way I approached it works, but gives me a warning.

Quote:
warning: class 'SoundAudioVewController' does not implement the 'AVAudioPlayerDelegate' protocol
So I imported the AV Foundation Framework into my project called "SoundAudio." In my SoundAudioViewController.m I entered the following code:

Code:
@implementation SoundAudioViewController
- (void)awakeFromNib {
		NSString *path = [[NSBundle mainBundle]	pathForResource:@"startApp" ofType:@"wav"];
		AVAudioPlayer* theAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path]error:NULL];
		theAudio.delegate = self;
		[theAudio play];
		
}
Is there a better way? Thanks!
ColouredRobot is offline   Reply With Quote
 

» Advertisements
» Online Users: 662
21 members and 641 guests
ADY, baja_yu, Creativ, dacapo, djbrooks111, Duncan C, e2applets, flamingliquid, headkaze, KarlJay, matador1978, msovani, MysticLine, Oral B, sacha1996, SLIC, smithdale87, SuperDietGenius, wiltwitt, Xaphann
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,421
Threads: 94,016
Posts: 402,540
Top Poster: BrianSlick (7,978)
Welcome to our newest member, maryleeag34
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:51 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.