0
0

This code works correctly in the docs but how do you detect whether ipod music is playing or not? I want to turn my game music off if ipod music is playing. Thanks!

  • You must to post comments
0
0

Check a bit further down in the docs, there is a section called "Determining if the iPod is playing". Essentially you use the FMOD_IPhone_OtherAudioIsPlaying function.

  • You must to post comments
0
0

Could you point me to that? I don’t see it in the docs. The only app I found to open .chm help files on Mac was "Chmox" which doesn’t seem to have the ability to search text. I also searched the header files in FMOD and don’t see any function called that. Thanks for your help!

  • You must to post comments
0
0

Platform specific information is now provided in the "Getting Started" guide PDF, you should see it next to the CHM docs file.

Or if you want to get right into it, just check out fmodiphone.h

  • You must to post comments
0
0

Sorry, I still can’t find it. I searched that header file and don’t see any function called FMOD_IPhone_OtherAudioIsPlaying.

  • You must to post comments
0
0

I checked the docs too in that section but still don’t see anything about this function. This is also my entire fmodiphone.h file. I’m not trying to be difficult but I seriously cannot find anything about this function.

[code:wwz733xn]/* ============================================================================================ /
/
FMOD iPhone Specific header file. Copyright (c), Firelight Technologies Pty, Ltd. 2005-2009. /
/
============================================================================================ */

ifndef _FMODIPHONE_H

define _FMODIPHONE_H

include "fmod.h"

/*
[ENUM]
[
[DESCRIPTION]
This will set the default audio session category to use for your application, see
the Apple documentation for detailed information about what each audio session
category does.

[REMARKS]
When using the recording API, FMOD will automatically switch to the "PlayAndRecord"
audio session category then switch back when recording is complete.

[PLATFORMS]
iPhone

[SEE_ALSO]

]
/
typedef enum
{
FMOD_IPHONE_SESSIONCATEGORY_DEFAULT, /
Default for the device OS version (MediaPlayback for iPhone OS 2.0 to 2.1, SoloAmbientSound for iPhone OS 2.2 onwards) /
FMOD_IPHONE_SESSIONCATEGORY_AMBIENTSOUND, /
kAudioSessionCategory_AmbientSound ~ obeys slient switch, silent when locked, mixes with other audio /
FMOD_IPHONE_SESSIONCATEGORY_SOLOAMBIENTSOUND, /
kAudioSessionCategory_SoloAmbientSound (iPhone OS >= 2.2 required) ~ obeys slient switch, silent when locked, doesn’t mix with other audio /
FMOD_IPHONE_SESSIONCATEGORY_MEDIAPLAYBACK, /
kAudioSessionCategory_MediaPlayback ~ ignores slient switch, plays when locked, doesn’t mix with other audio /
FMOD_IPHONE_SESSIONCATEGORY_PLAYANDRECORD, /
kAudioSessionCategory_PlayAndRecord ~ ignores slient switch, plays when locked, doesn’t mix with other audio */

FMOD_IPHONE_SESSIONCATEGORY_FORCEINT = 65536    /* Makes sure this enum is signed 32bit */

} FMOD_IPHONE_SESSIONCATEGORY;

/*
[STRUCTURE]
[
[DESCRIPTION]
Use this structure with System::init to set the information required for
iPhone initialisation.

Pass this structure in as the "extradriverdata" parameter in System::init.

[REMARKS]

[PLATFORMS]
iPhone

[SEE_ALSO]
System::init

]
/
typedef struct FMOD_IPHONE_EXTRADRIVERDATA
{
FMOD_IPHONE_SESSIONCATEGORY sessionCategory; /
(IN) Default audio session category to use for output /
bool forceSpeakerOutput; /
(IN) Force audio out the main speaker, don’t allow output to be redirected to the receiver speaker when recording (iPhone OS >= 2.1 required) /
bool *otherAudioPlaying; /
(OUT) Whether an external audio source (i.e. iPod) is playing after System::init is complete. */
} FMOD_IPHONE_EXTRADRIVERDATA;

endif

[/code:wwz733xn]

  • You must to post comments
0
0

Hi OrganicBytes,

I looked through the iPhone source and I can see that function defined in both dev 4.33 and stable 4.32. What version are you using?

  • You must to post comments
0
0

Ah! I was using 4.30.01. Updated to the latest version and found the function!

One thing though, on the Simulator it’s always returning true even though it’s not possible to play other audio. Is this designed behavior?

  • You must to post comments
0
0

Yes that is the desired behavior.

If you check the TTY output of the logging version you can see it will say it could not determine if external audio was playing, this is because the feature isn’t supported in the simulator.

We default to true no matter why it couldn’t determine the state because it’s better to err on the side of caution than tell the user external audio isn’t playing when it is.

  • You must to post comments
Showing 8 results
Your Answer

Please first to submit.