Closed ihdream72 closed 5 months ago
I made the following modifications to the 'record_darwin/darwin/Classes/delegate/RecorderStreamDelegate.swift' file I did that and it works fine on MacOS. Please check it out and let me know if you can update it.
private func stream(
buffer: AVAudioPCMBuffer,
dstFormat: AVAudioFormat,
converter: AVAudioConverter,
recordEventHandler: RecordStreamHandler
) -> Void {
...
...
// 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)
...
...
}
Thanks, can you fill a PR for this? Also, it should be tested on iOS since this code is shared between the platforms.
Package version 5.1.1
Environment
I am developing a service where I want to record stream audio from multiple platforms and use Google's Speech to Text service.
Recording as above works fine on Android, but not on MacOS. If you look at the logs left behind on MacOS, you'll see the following
Can you confirm this issue?
I appreciates the your effort.