You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been exploring the audio recording feature introduced in Pull Request #85. I'm utilizing the Room.audioProcessingModule.capturePostProcessingDelegate for this purpose, however, I am encountering an issue where the recorded audio has a noise or distortion sound.
I have checked the sample rates, bit depths, buffer sizes, and codec settings to ensure they are configured correctly, but the issue persists. I suspect it might be related to the audio processing settings or possibly a mismatch in configuration somewhere.
Could you please provide some insight or assistance on how I might resolve this? I would really appreciate any help or guidance you can provide.
Thank you for your time and consideration.
Best regards,
Sandeep
The text was updated successfully, but these errors were encountered:
isandeepj
changed the title
Issue with Robotic Sound During Audio Recording Using PR #85
Issue with Noise or Distortion Sound During Audio Recording Using PR #85
Sep 26, 2023
Yes, for 32-bit floating-point audio data, the range is typically from -1.0 to 1.0. However, the audio frame sample range is not within this range, so it needs to be downscaled by a factor of 32768.
private func convertToPCMBuffer(_ audioBuffer: RTCAudioBuffer) -> AVAudioPCMBuffer? {
// ... (rest of code)
for channelIndex in 0..<numChannels {
let audioBufferPointer = audioBuffer.rawBuffer(forChannel: channelIndex)
guard let targetBufferPointer = pcmBuffer.floatChannelData?[channelIndex] else {
print("Failed to get target buffer for channel \(channelIndex)")
return nil
}
// Now normalize and copy the data
var targetChannelPointer = targetBufferPointer
let normalizationFactor: Float = 32768.0 // This value is used to normalize the audio sample values
for frameIndex in 0..<numFrames {
let sampleValue = audioBufferPointer[frameIndex]
let normalizedSampleValue = sampleValue / normalizationFactor // Normalizing the sample value
targetChannelPointer[frameIndex * channelStride] = normalizedSampleValue
}
}
// ... (rest of code)
}
Hello @hiroshihorie and team,
I have been exploring the audio recording feature introduced in Pull Request #85. I'm utilizing the Room.audioProcessingModule.capturePostProcessingDelegate for this purpose, however, I am encountering an issue where the recorded audio has a noise or distortion sound.
Here is a link to the AudioRecorderHandler implementation I am using:
AudioRecorderHandler.zip
I have checked the sample rates, bit depths, buffer sizes, and codec settings to ensure they are configured correctly, but the issue persists. I suspect it might be related to the audio processing settings or possibly a mismatch in configuration somewhere.
Could you please provide some insight or assistance on how I might resolve this? I would really appreciate any help or guidance you can provide.
Thank you for your time and consideration.
Best regards,
Sandeep
The text was updated successfully, but these errors were encountered: