1616
1717import AVFAudio
1818
19+ #if swift(>=5.9)
20+ internal import LiveKitWebRTC
21+ #else
22+ @_implementationOnly import LiveKitWebRTC
23+ #endif
24+
25+ public let AudioEngineInputMixerNodeKey = kRTCAudioEngineInputMixerNodeKey
26+
1927/// Do not retain the engine object.
2028public protocol AudioEngineObserver : NextInvokable , Sendable {
2129 associatedtype Next = any AudioEngineObserver
@@ -31,11 +39,11 @@ public protocol AudioEngineObserver: NextInvokable, Sendable {
3139 /// Provide custom implementation for internal AVAudioEngine's output configuration.
3240 /// Buffers flow from `src` to `dst`. Preferred format to connect node is provided as `format`.
3341 /// Return true if custom implementation is provided, otherwise default implementation will be used.
34- func engineWillConnectOutput( _ engine: AVAudioEngine , src: AVAudioNode , dst: AVAudioNode ? , format: AVAudioFormat ) -> Bool
42+ func engineWillConnectOutput( _ engine: AVAudioEngine , src: AVAudioNode , dst: AVAudioNode ? , format: AVAudioFormat , context : [ AnyHashable : Any ] )
3543 /// Provide custom implementation for internal AVAudioEngine's input configuration.
3644 /// Buffers flow from `src` to `dst`. Preferred format to connect node is provided as `format`.
3745 /// Return true if custom implementation is provided, otherwise default implementation will be used.
38- func engineWillConnectInput( _ engine: AVAudioEngine , src: AVAudioNode ? , dst: AVAudioNode , format: AVAudioFormat ) -> Bool
46+ func engineWillConnectInput( _ engine: AVAudioEngine , src: AVAudioNode ? , dst: AVAudioNode , format: AVAudioFormat , context : [ AnyHashable : Any ] )
3947}
4048
4149/// Default implementation to make it optional.
@@ -64,11 +72,11 @@ public extension AudioEngineObserver {
6472 next? . engineWillRelease ( engine)
6573 }
6674
67- func engineWillConnectOutput( _ engine: AVAudioEngine , src: AVAudioNode , dst: AVAudioNode ? , format: AVAudioFormat ) -> Bool {
68- next? . engineWillConnectOutput ( engine, src: src, dst: dst, format: format) ?? false
75+ func engineWillConnectOutput( _ engine: AVAudioEngine , src: AVAudioNode , dst: AVAudioNode ? , format: AVAudioFormat , context : [ AnyHashable : Any ] ) {
76+ next? . engineWillConnectOutput ( engine, src: src, dst: dst, format: format, context : context )
6977 }
7078
71- func engineWillConnectInput( _ engine: AVAudioEngine , src: AVAudioNode ? , dst: AVAudioNode , format: AVAudioFormat ) -> Bool {
72- next? . engineWillConnectInput ( engine, src: src, dst: dst, format: format) ?? false
79+ func engineWillConnectInput( _ engine: AVAudioEngine , src: AVAudioNode ? , dst: AVAudioNode , format: AVAudioFormat , context : [ AnyHashable : Any ] ) {
80+ next? . engineWillConnectInput ( engine, src: src, dst: dst, format: format, context : context )
7381 }
7482}
0 commit comments