Skip to content

Commit

Permalink
fix(darwin): incorrect PCM16 Audio Stream data #336 (#337)
Browse files Browse the repository at this point in the history
Incorrect buffer size for sending Streams and increasing the size
  • Loading branch information
ihdream72 committed Jun 7, 2024
1 parent 0bc1bbe commit 2242ae3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class RecorderStreamDelegate: NSObject, AudioRecordingStreamDelegate {
}

// Determine frame capacity
let capacity = (UInt32(dstFormat.sampleRate) * dstFormat.channelCount * buffer.frameLength) / (UInt32(buffer.format.sampleRate) * buffer.format.channelCount)
let capacity = (UInt32(dstFormat.sampleRate) * dstFormat.channelCount * buffer.frameLength * 2) / (UInt32(buffer.format.sampleRate) * buffer.format.channelCount)

// Destination buffer
guard let convertedBuffer = AVAudioPCMBuffer(pcmFormat: dstFormat, frameCapacity: capacity) else {
Expand Down

0 comments on commit 2242ae3

Please sign in to comment.