Core Audio'nun yeni iOS 7 Inter App Audio teknolojisi'u kullanan bir HOST uygulaması yazıyorum. Cihaz uygulamalarını ve efekt uygulamasını Inter-App Audio Examples yardımı ile almayı başardım.Inter App Audio teknolojisi: efekt düğümü ve cihaz düğümünden bağımsız olun
sorun etkisi düğümü alet düğüm üzerine bağımlı olmasıdır. efekt düğümü ve cihaz düğümünden bağımsız yapmak istiyorum.
İşte benim Denemelerim.
if (desc.componentType == kAudioUnitType_RemoteEffect) {
// if ([self isRemoteInstrumentConnected]) {
if (!_engineStarted) // Check if session is active
[self checkStartOrStopEngine];
if ([self isGraphStarted]) // Check if graph is running and or is created, if so, stop it
[self checkStartStopGraph];
if ([self checkGraphInitialized ]) // Check if graph has been inititialized if so, uninitialize it.
Check(AUGraphUninitialize(hostGraph));
Check (AUGraphAddNode (hostGraph, &desc, &effectNode)); // Add remote instrument
//Disconnect previous chain
// Check(AUGraphDisconnectNodeInput(hostGraph, mixerNode, remoteBus));
//Connect the effect node to the mixer on the remoteBus
Check(AUGraphConnectNodeInput (hostGraph, effectNode, 0, mixerNode, remoteBus));
//Connect the remote instrument node to the effect node on bus 0
Check(AUGraphConnectNodeInput (hostGraph, instrumentNode, 0, effectNode, 0));
//Grab audio units from the graph
Check(AUGraphNodeInfo(hostGraph, effectNode, 0, &effect));
currentUnit = &effect;
}
if (currentUnit) {
Check (AudioUnitSetProperty (*currentUnit, // Set stereo format
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Output,
playerBus,
&stereoStreamFormat,
sizeof (stereoStreamFormat)));
UInt32 maxFrames = 4096;
Check(AudioUnitSetProperty(*currentUnit,
kAudioUnitProperty_MaximumFramesPerSlice,
kAudioUnitScope_Global, playerBus,
&maxFrames,
sizeof(maxFrames)));
[self addAudioUnitPropertyListeners:*currentUnit]; // Add property listeners to audio unit
Check(AUGraphInitialize (hostGraph)); // Initialize the graph
[self checkStartStopGraph]; //Start the graph
}
[_connectedNodes addObject:rau];
ama bu Line benim Uygulama Çöküyor -
Check(AUGraphInitialize (hostGraph));
Ve ben var Hata,
ConnectAudioUnit-10860 başlatma hatası
başarısız oldu hatayla başarısız oldu-10860 e AUGraphInitialize (hostGraph) den rror -10860
Not: - Ben de daha iyi kod kısmının ekran görüntüsünü Ekli anladım.
1 Düzenleme: -
- (void)createGraph {
// 1
NewAUGraph(&hostGraph);
// 2
AudioComponentDescription iOUnitDescription;
iOUnitDescription.componentType =
kAudioUnitType_Output;
iOUnitDescription.componentSubType =
kAudioUnitSubType_RemoteIO;
iOUnitDescription.componentManufacturer =
kAudioUnitManufacturer_Apple;
iOUnitDescription.componentFlags = 0;
iOUnitDescription.componentFlagsMask = 0;
AUGraphAddNode(hostGraph, &iOUnitDescription, &outNode);
// 3
AUGraphOpen(hostGraph);
// 4
Check(AUGraphNodeInfo(hostGraph, outNode, 0, &outputUnit));
// 5
AudioStreamBasicDescription format;
format.mChannelsPerFrame = 2;
format.mSampleRate =
[[AVAudioSession sharedInstance] sampleRate];
format.mFormatID = kAudioFormatLinearPCM;
format.mFormatFlags =
kAudioFormatFlagsNativeFloatPacked |
kAudioFormatFlagIsNonInterleaved;
format.mBytesPerFrame = sizeof(Float32);
format.mBytesPerPacket = sizeof(Float32);
format.mBitsPerChannel = 32;
format.mFramesPerPacket = 1;
AudioUnitSetProperty(mixerUnit,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Output,
1,
&format,
sizeof(format));
AudioUnitSetProperty(mixerUnit,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Input,
0,
&format,
sizeof(format));
CAShow(hostGraph);
}
Tekrar gösterim için teşekkürler. Biraz daha ayrıntılı olarak açıklayabilir misiniz? gibi, Grafik oluştururken yapılması gereken değişiklikler nelerdir? Kod ile tam olarak ne kaldırılmalı? –
Bu yöntemde denediğiniz şeyi göndermediğinizden, gerçekten yapamam.Sağladığınız bilgilere dayanarak, olabildiğince fazla ayrıntı sağladım, ancak tüm bunları örnek bir uygulamadan birkaç satırı sildiğinizden emin olarak, Denemelerinizi anlayamadan sorunu çözmeniz gerekiyor (ki şimdiye kadar gördüğüm tek şey, kaldırılan bir çift satırlı örnek uygulama bölümü kopyalanmış, başka hiçbir değişiklik yok). – BHendricks
Düzenlenmiş kodum var. üzerine bakabilir misin lütfen? –