Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID
Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.

Audio question for xcode 4

conceptualistconceptualist Posts: 15Registered Users
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
Post edited by conceptualist on
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

Replies

  • conceptualistconceptualist Posts: 15Registered Users
    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. :confused::confused::(



    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
  • conceptualistconceptualist Posts: 15Registered Users
    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
Sign In or Register to comment.