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 > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 06-17-2010, 09:36 AM   #1 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 141
eski is on a distinguished road
Default audio clip pausing ipod music - how can i stop this?

hi,
i have a button that when pressed plays a short sound, here is my code....


Code:
clickoutsound2 = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"clickoutsound2" ofType:@"wav"]] error:NULL];
	clickoutsound2.volume = 0.6;
	[clickoutsound2 play];
my problem is that if the ipod/iphone is all ready playing music it pauses it..then plays the short sound.

is there a simple way to code it so it does NOT pause the music but just plays over it???

thanks in advance

dan
eski is offline   Reply With Quote
Old 06-19-2010, 08:34 PM   #2 (permalink)
Banned
 
Join Date: Jul 2009
Posts: 576
Not_Appy_At_All is on a distinguished road
Default

Quote:
Originally Posted by eski View Post
hi,
i have a button that when pressed plays a short sound, here is my code....


Code:
clickoutsound2 = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"clickoutsound2" ofType:@"wav"]] error:NULL];
	clickoutsound2.volume = 0.6;
	[clickoutsound2 play];
my problem is that if the ipod/iphone is all ready playing music it pauses it..then plays the short sound.

is there a simple way to code it so it does NOT pause the music but just plays over it???

thanks in advance

dan

Yes...

Google the following...

"AVAudioSessionCategoryAmbient"

It will do exactly what you want.
Not_Appy_At_All is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 330
9 members and 321 guests
Absentia, Chickenrig, Domele, fiftysixty, givensur, heshiming, michaelhansen, PixelInteractive, Sloshmonster
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,892
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:16 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0