オーディオ ジャックを介してデバイスからサウンドを録音する iPhoneApp を作成しています。コードをコンパイルしようとしましたが、
'CFDictionaryRef' 型 (別名 'const_CFDictionary*') の変数を 'const void*' 型の左辺値で初期化できません ここに私のコードの一部があります:
#pragma mark Audio session callbacks_______________________
// Audio session callback function for responding to audio route changes. If playing
// back application audio when the headset is unplugged, this callback pauses
// playback and displays an alert that notifies the user that power has been terminated.
//
// The system takes care of iPod audio pausing during route changes--this callback
// is not involved with pausing playback of iPod audio.
void audioRouteChangeListenerCallback (
void *inUserData,
AudioSessionPropertyID inPropertyID,
UInt32 inPropertyValueSize,
const void *inPropertyValue
) {
// ensure that this callback was invoked for a route change
if (inPropertyID != kAudioSessionProperty_AudioRouteChange) return;
// This callback, being outside the implementation block, needs a reference to the
// MainViewController object, which it receives in the inUserData parameter.
// You provide this reference when registering this callback (see the call to
// AudioSessionAddPropertyListener).
MaxViewController *controller = (__bridge MaxViewController *) inUserData;
// if application sound is not playing, there's nothing to do, so return.
if (controller.sound.playing == 0 ) {
NSLog (@"Audio route change while application audio is stopped.");
return;
} else {
// Determines the reason for the route change, to ensure that it is not // because of a category change.
CFDictionaryRef routeChangeDictionary = inPropertyValue;
CFNumberRef routeChangeReasonRef =
CFDictionaryGetValue (
routeChangeDictionary,
CFSTR (kAudioSession_AudioRouteChangeKey_Reason)
);
SInt32 routeChangeReason;
ここで、可能なすべての結果をスタックオーバーフローや他の場所で検索しましたが、失敗したことが証明されています。どんな助けでも大歓迎です。前もって感謝します。