私は最近、新しいプロジェクトのために AudioKit v3.3 をいじっていて、AK3DPanner と呼ばれる 3D 空間化ノードで壁にぶつかっています。ある時点で、すべての音を左耳または右耳のどちらかで再生するという、非常に粗雑に見えましたが、実行することができました。期待するものではありません。
いずれにせよ、問題は起動さえしないことです。これを遊び場に置くと、私が知る限りうまくいくはずですが、クラッシュします:
let drip = AKDrip(intensity: 1)
let pan = AK3DPanner(drip)
AudioKit.output = pan
AudioKit.start() // Crashes here
drip.start()
AKPlaygroundLoop(every: 1) {
drip.trigger()
}
コンソールはこれを記録します:
2016-09-13 13:52:52.395 FM Oscillator Operation[54225:910643] 13:52:52.395 ERROR: AVAudioEngineGraph.mm:2510: PerformCommand: error -10875
2016-09-13 13:52:52.398 FM Oscillator Operation[54225:910643] *** Terminating app due to uncaught exception 'com.apple.coreaudio.avfaudio', reason: 'error -10875'
*** First throw call stack:
(
0 CoreFoundation 0x000000010f22bd85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010ec9fdeb objc_exception_throw + 48
2 CoreFoundation 0x000000010f22bbea +[NSException raise:format:arguments:] + 106
3 libAVFAudio.dylib 0x000000011c566ff3 _Z19AVAE_RaiseExceptionP8NSStringz + 176
4 libAVFAudio.dylib 0x000000011c5783fb _ZNK18AVAudioEngineGraph14PerformCommandER11AUGraphNodeNS_12ENodeCommandEPvj + 1571
5 libAVFAudio.dylib 0x000000011c581bcd _ZNSt3__110__function6__funcIZN13AUGraphParser34InitializeActiveNodesInOutputChainER18AVAudioEngineGraph14ETraversalModeR11AUGraphNodeRbE3$_8NS_9allocatorIS9_EEF16ETraversalStatusS7_P17AUGraphConnectionEEclES7_OSE_ + 231
6 libAVFAudio.dylib 0x000000011c582c2f _ZNKSt3__18functionIF16ETraversalStatusR11AUGraphNodeP17AUGraphConnectionEEclES3_S5_ + 31
7 libAVFAudio.dylib 0x000000011c575208 _ZN13AUGraphParser18TraverseGraphNodesERK18AVAudioEngineGraph10EDirection10ERecursionR11AUGraphNodeP17AUGraphConnectionRKNSt3__18functionIF16ETraversalStatusS6_S8_EEE + 48
8 libAVFAudio.dylib 0x000000011c5762bb _ZN13AUGraphParser34InitializeActiveNodesInOutputChainER18AVAudioEngineGraph14ETraversalModeR11AUGraphNodeRb + 833
9 libAVFAudio.dylib 0x000000011c57921f _ZN18AVAudioEngineGraph10InitializeEv + 1031
10 libAVFAudio.dylib 0x000000011c5b12b5 _ZN17AVAudioEngineImpl10InitializeEv + 29
11 libAVFAudio.dylib 0x000000011c5b0827 -[AVAudioEngine prepare] + 58
12 AudioKit 0x000000011d23fb92 _TZFC8AudioKit8AudioKit5startfT_T_ + 258
13 ??? 0x000000011a3f86d5 0x0 + 4735338197
14 FM Oscillator Operation 0x000000010e72fab0 main + 0
15 FM Oscillator Operation 0x000000010e7329a1 _TTRXFo__dT__XFo_iT__iT__ + 17
16 FM Oscillator Operation 0x000000010e732401 _TPA__TTRXFo__dT__XFo_iT__iT__ + 81
17 FM Oscillator Operation 0x000000010e7329d0 _TTRXFo_iT__iT__XFo__dT__ + 32
18 FM Oscillator Operation 0x000000010e732a07 _TTRXFo__dT__XFdCb__dT__ + 39
19 CoreFoundation 0x000000010f1512ec __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
20 CoreFoundation 0x000000010f146f75 __CFRunLoopDoBlocks + 341
21 CoreFoundation 0x000000010f1466d2 __CFRunLoopRun + 850
22 CoreFoundation 0x000000010f1460f8 CFRunLoopRunSpecific + 488
23 GraphicsServices 0x0000000115d0bad2 GSEventRunModal + 161
24 UIKit 0x000000010f5e1f09 UIApplicationMain + 171
25 FM Oscillator Operation 0x000000010e72ff39 main + 1161
26 libdyld.dylib 0x0000000111f7192d start + 1
27 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
さらに、print(AudioKit.engine)
クラッシュの直前にこれを取得すると、次のようになります。
________ GraphDescription ________
AVAudioEngineGraph 0x7f97d9437f40: initialized = 0, running = 0, number of nodes = 3
******** output chain ********
node 0x7f97d9611d90 {'auou' 'rioc' 'appl'}, 'U'
inputs = 1
(bus0) <- (bus0) 0x7f97d943c910, {'aumx' '3dem' 'appl'}, [ 2 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
node 0x7f97d943c910 {'aumx' '3dem' 'appl'}, 'U'
inputs = 33
(bus0) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus1) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus2) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus3) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus4) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus5) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus6) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus7) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus8) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus9) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus10) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus11) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus12) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus13) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus14) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus15) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus16) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus17) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus18) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus19) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus20) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus21) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus22) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus23) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus24) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus25) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus26) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus27) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus28) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus29) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus30) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus31) <- (bus0) 0x0, {}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
(bus32) <- (bus0) 0x7f97d9437780, {'augn' 'drip' 'AuKt'}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
outputs = 1
(bus0) -> (bus0) 0x7f97d9611d90, {'auou' 'rioc' 'appl'}, [ 2 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
node 0x7f97d9437780 {'augn' 'drip' 'AuKt'}, 'U'
outputs = 1
(bus0) -> (bus32) 0x7f97d943c910, {'aumx' '3dem' 'appl'}, [ 1 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved]
______________________________________
また、AudioKit プレイグラウンドを実行しているときに常にこのエラーが発生することにも注意してください。ただし、それでも常に機能します。
2016-09-13 13:52:52.364 FM Oscillator Operation[54225:910777] 13:52:52.363 WARNING: 40: ERROR: couldn't get default input device, ID = 0, err = 0!
2016-09-13 13:52:52.375 FM Oscillator Operation[54225:910777] 13:52:52.375 WARNING: 803: The default input device 0x0 '(null)' has no input channels.
最後に、以下のようにパナー ノードを削除すると、正常に動作します。
let drip = AKDrip(intensity: 1)
AudioKit.output = drip
AudioKit.start()
drip.start()
AKPlaygroundLoop(every: 1) {
drip.trigger()
}
これに関する洞察に非常に感謝しています。このプロジェクトではバイノーラル オーディオが重要であるため、オーディオ エンジンを切り替える必要があります。