diff --git a/README.md b/README.md index 6f2c6bb08..c6cc9beae 100644 --- a/README.md +++ b/README.md @@ -272,6 +272,11 @@ stream.play() ```swift stream.frameRate = 30 stream.sessionPreset = AVCaptureSession.Preset.medium + +// Do not call beginConfiguration() and commitConfiguration() internally within the scope of the method, as they are called internally. +stream.configuration { session in + session.automaticallyConfiguresApplicationAudioSession = true +} ``` ### 🔊 Audio @@ -284,15 +289,18 @@ stream.attachAudio(front, track: 0) { audioUnit, error in ``` #### [AudioMixerSettings](https://shogo4405.github.io/HaishinKit.swift/Structs/IOAudioMixerSettings.html) -When you specify the sampling rate, it will perform resampling. Additionally, in the case of multiple channels, downsampling can be applied. +If you want to mix multiple audio tracks, please enable the Feature flag. +```swift +FeatureUtil.setEnabled(for: .multiTrackAudioMixing, isEnabled: true) +``` +When you specify the sampling rate, it will perform resampling. Additionally, in the case of multiple channels, downsampling can be applied. ```swift -// If you want to mix multiple audio tracks, please enable the Feature flag. -// FeatureUtil.setEnabled(for: .multiTrackAudioMixing, isEnabled: true) stream.audioMixerSettings = IOAudioMixerSettings( - channels: UInt32 = 1, - sampleRate: Float64 = 44100, + channels: UInt32 = 0, // Setting the value to 0 will be the same as the value specified in mainTrack. + sampleRate: Float64 = 44100, // Setting the value to 0 will be the same as the value specified in mainTrack. ) + stream.audioMixerSettings.isMuted = false stream.audioMixerSettings.mainTrack = 0 stream.audioMixerSettings.tracks = [ @@ -323,13 +331,13 @@ stream.attachCamera(front, track: 0) { videoUnit, error in } ``` -#### [VideoMixerSettings](https://shogo4405.github.io/HaishinKit.swift/Structs/VideoMixerSettings.html) +#### [VideoMixerSettings](https://shogo4405.github.io/HaishinKit.swift/Structs/IOVideoMixerSettings.html) ```swift stream.videoMixerSettings = init( - mode: Mode, - cornerRadius: CGFloat, - regionOfInterest: CGRect, - direction: ImageTransform + mode: Mode, + cornerRadius: CGFloat, + regionOfInterest: CGRect, + direction: ImageTransform ) ``` diff --git a/Sources/IO/IOStream.swift b/Sources/IO/IOStream.swift index 013f26dc8..b85e090c3 100644 --- a/Sources/IO/IOStream.swift +++ b/Sources/IO/IOStream.swift @@ -422,7 +422,7 @@ open class IOStream: NSObject { /// Configurations for the AVCaptureSession. @available(tvOS 17.0, *) - func configuration(_ lambda: (_ session: AVCaptureSession) throws -> Void) rethrows { + public func configuration(_ lambda: (_ session: AVCaptureSession) throws -> Void) rethrows { try mixer.session.configuration(lambda) }