음소거 스위치는 여기를 참조하십시오. http://www.restoroot.com/Blog/2008/12/25/audiosessioninitialize-workarounds/
본질적으로 당신은 단지 이것을 필요로합니다.
// "Ambient" makes it respect the mute switch
// Must call this once to init session
if (!gAudioSessionInited)
{
AudioSessionInterruptionListener inInterruptionListener = NULL;
OSStatus error;
if ((error = AudioSessionInitialize (NULL, NULL, inInterruptionListener, NULL)))
{
NSLog(@"*** Error *** GBMusicTrack - initWithPath: error in AudioSessionInitialize: %d.", error);
}
else
{
gAudioSessionInited = YES;
}
}
SInt32 ambient = kAudioSessionCategory_AmbientSound;
if (AudioSessionSetProperty (kAudioSessionProperty_AudioCategory, sizeof (ambient), &ambient))
{
NSLog(@"*** Error *** GBMusicTrack - initWithPath: could not set Session property to ambient.");
}
시스템 기본 설정을 읽는 것은 적어도 공개 API를 통해서는 불가능합니다.
고마워요. 쓴 뉴스 - 한편으로는 사과가 (UI에서 ... 주제 : 사용자가 기대하는 것) ... 그리고 다른 한편으로는 "사용자가 기대하는 것"에서 중요한 설정에 액세스하지 못합니다 ". 제 상황에서는 키보드의 사운드가 사용자가 전 세계적으로 설정 한 것에 의존 할 수 없습니다. "애니메이션 사운드"는 "자동 스위치"에 의존 할 수 없습니다. "오디오 세션이 완전히 지원되지 않음"을 의미하는 모노 터치를 사용하며 오디오 세션을 사용하지 않습니다. PlaySystemSound를 사용합니다. – ManniAT
음소거 스위치 설정을 존중하는 한 괜찮을 것이라고 생각합니다. –
음소거 스위치를 존중하는 내 문제 - Monotouch는 AudioSession에 대한 액세스를 제공하지 않습니다 (또는 적어도 완료되지 않았 음). "배경 오디오가 오리 야"라고 구현했을 때 이것을 배웠습니다 – ManniAT