Skip to content

Commit

Permalink
Various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
laktyushin committed Nov 28, 2023
1 parent 6fc47be commit 60b6d45
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion submodules/Camera/Sources/CameraOutput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ extension CameraOutput: AVCaptureVideoDataOutputSampleBufferDelegate, AVCaptureA
if let videoPixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer) {
self.processSampleBuffer?(sampleBuffer, videoPixelBuffer, connection)
} else {
self.processAudioBuffer?(sampleBuffer)
// self.processAudioBuffer?(sampleBuffer)
}

if let videoRecorder = self.videoRecorder, videoRecorder.isRecording {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,14 @@ public final class MediaEditor {
return values.withUpdatedVideoVolume(volume)
}

if let audioMix = self.playerAudioMix, let asset = self.player?.currentItem?.asset {
let audioMix: AVMutableAudioMix
if let current = self.playerAudioMix {
audioMix = current
} else {
audioMix = AVMutableAudioMix()
self.playerAudioMix = audioMix
}
if let asset = self.player?.currentItem?.asset {
let audioMixInputParameters = AVMutableAudioMixInputParameters(track: asset.tracks(withMediaType: .audio).first)
audioMixInputParameters.setVolume(Float(volume ?? 1.0), at: .zero)
audioMix.inputParameters = [audioMixInputParameters]
Expand Down

0 comments on commit 60b6d45

Please sign in to comment.