User Tag List

Results 1 to 10 of 10

Thread: How to allow you applications to let background music play

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Aug 2011
    Location
    Beverly Hills, CA USA
    Posts
    511
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to allow you applications to let background music play

    One complaint I often get is that once my app starts music and other background apps making sounds stop playing.

    Go to your app in XCode and find the file Classes\Application\CSoundPlayer.m and the method initWithApp. Once there change the following from ...

    UInt32 sessionCategory=kAudioSessionCategory_SoloAmbientS ound;
    AudioSessionSetProperty(kAudioSessionCategory_Solo AmbientSound, sizeof(sessionCategory), &sessionCategory);

    To:

    UInt32 sessionCategory=kAudioSessionCategory_AmbientSound ;
    AudioSessionSetProperty(kAudioSessionProperty_Audi oCategory, sizeof(sessionCategory), &sessionCategory);

    Now gamers can listen to Spotify and play the latest MMF2 creation.

  2. #2
    Clicker

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleUnicode Add-onInstall Creator Pro
    StingRay's Avatar
    Join Date
    Nov 2006
    Location
    Austria
    Posts
    1,096
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Thanks for this tip, Keith!

    Is there a Way to play the Music of an mmf app Even if the User minimize it?!?

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Aug 2011
    Location
    Beverly Hills, CA USA
    Posts
    511
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There certainly is but it would require more substantial changes in a few places.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module

    Join Date
    Jul 2006
    Location
    S.East England
    Posts
    744
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nice work!

  5. #5
    Clickteam Clickteam
    Olivier's Avatar
    Join Date
    Jun 2006
    Posts
    3,003
    Mentioned
    9 Post(s)
    Tagged
    1 Thread(s)
    Interesting, thanks for sharing Keith. Please Clickteam, make a new property in MMF so we can easily leverage this.

  6. #6
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,017
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)
    Keith, could you let me know either here or PM how to get the music to keep playing when the app is minimized? My Obj-C coder is going around in circles trying to find the answer... It would be highly appreciated if you could.

    Thanks in advance!

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Aug 2011
    Location
    Beverly Hills, CA USA
    Posts
    511
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have not implemented it Danny sorry.

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module

    Join Date
    Jul 2006
    Location
    S.East England
    Posts
    744
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i got an error after changing this complaining use of undeclared identifier.

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    EtiennePerin's Avatar
    Join Date
    Sep 2011
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Redsquirrel View Post
    i got an error after changing this complaining use of undeclared identifier.
    In case you didn't find it yourself, you must remove a space in "Audi oCategory"

    Like this =>

    UInt32 sessionCategory=kAudioSessionCategory_AmbientSound ;
    AudioSessionSetProperty(kAudioSessionProperty_Audi oCategory, sizeof(sessionCategory), &sessionCategory);

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    EtiennePerin's Avatar
    Join Date
    Sep 2011
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ho... it seems that the forum put the space by itself... weird.
    Well, you'll remove it in Xcode.

Similar Threads

  1. music in MMF2 - can music play across frames
    By RoguePixel in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 5th April 2017, 06:16 PM
  2. [PAID] Seamless Looping OGG/Music Player Extension (to play music with loop points)
    By DinnerSonic in forum Paid Design & Development Requests
    Replies: 0
    Last Post: 6th October 2013, 07:27 PM
  3. Play music in the background using AVAudioplayer
    By StingRay in forum iOS Specific Example Files
    Replies: 1
    Last Post: 12th July 2013, 04:55 PM
  4. Background Applications
    By Ethan in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 24th May 2010, 10:39 PM
  5. Sub applications in background
    By Nick in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 20th May 2007, 10:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •