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-03-2011, 09:59 AM   #1 (permalink)
Registered Member
 
Join Date: Jan 2011
Location: usa
Posts: 15
conceptualist is on a distinguished road
Default Audio question for xcode 4

Hi, when my app plays the itunes app ceases to run i nthe background. My app was built using the mediaplayer framework. My video clip contains no sound. I want to know which audio framework should I use to mute my app's sound and send a flag to the itunes app allowing it to uninterrupted continue in background playback during my app session?

Once I import the proper audio framework.

I think the proper code to mute all sounds in my app with flags to allow uninterupted itunes app background playback would be...

OSStatus AudioSessionSetActiveWithFlags (
Boolean false,
UInt32 inFlags
);


Would appreciate any feedback on this. I think I am on the right track but I am not sure. Any hints, links or comments would be well appreciated.

Oi
__________________
Macbook Pro i7 2.2
Macbook Pro i7 2.66 -(past)
12 inch Powerbook G4 1.5
iphone 4
imac 233 Bondi Blue
Airport Extreme
conceptualist is offline   Reply With Quote
Old 06-05-2011, 09:36 PM   #2 (permalink)
Registered Member
 
Join Date: Jan 2011
Location: usa
Posts: 15
conceptualist is on a distinguished road
Default

I am really upset over all of this. Ihave attempted to set up code to handle this operation however I am on the wrong track. The fact that no one has offered any hints or anyhting also further depresses me. So i continue to look for the answer on my own.

i came across this bit of code that I feel is proper for my situation. However I have failed to introduce it properly into my project and of course there are errors. I am simply trying to enable the ipod app (started prior) to continue playback during my app's session. Along with enabled ipod toolbar controls.

I think this code may be the ticket? What do you think? I think ambient sound is what i want. as opposed to calling the solo ambient which I believe prevents ipod playback.



BOOL is_iPodPlaying = NO;
MPMusicPlayerController *iPodMusicPlayer = [MPMusicPlayerController iPodMusicPlayer];
if (iPodMusicPlayer.playbackState == MPMusicPlaybackStatePlaying) {
is_iPodPlaying = YES;
}
SPAudioSessionCategory soundCat = (is_iPodPlaying > 0) ? SPAudioSessionCategory_AmbientSound : SPAudioSessionCategory_AmbientSound;
[SPAudioEngine start:SPAudioSessionCategory_AmbientSound];
[SPAudioEngine start:soundCat];
__________________
Macbook Pro i7 2.2
Macbook Pro i7 2.66 -(past)
12 inch Powerbook G4 1.5
iphone 4
imac 233 Bondi Blue
Airport Extreme
conceptualist is offline   Reply With Quote
Old 06-07-2011, 10:40 PM   #3 (permalink)
Registered Member
 
Join Date: Jan 2011
Location: usa
Posts: 15
conceptualist is on a distinguished road
Default

I dropped a bare music player into my project by modifying my delegate. however, playback is still hindered by the instance of the media player's clip playback. i am looking to automute my clip's sound and allow for in app playback of my itunes library content. Apple's documentation is not so clear in regards to the media player framework. And 3rd party guides rarely devote more than 4 pages to the entire class und framework! Ich bin stressed.
__________________
Macbook Pro i7 2.2
Macbook Pro i7 2.66 -(past)
12 inch Powerbook G4 1.5
iphone 4
imac 233 Bondi Blue
Airport Extreme
conceptualist is offline   Reply With Quote
Reply

Bookmarks

Tags
audio, xcode 4

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: 328
5 members and 323 guests
Dnnake, iOS.Lover, jenniead38, pbart, Wikiboo
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,663
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, LezB44
Powered by vBadvanced CMPS v3.1.0

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