if a sample rate conversion is requested, always honour it
This commit is contained in:
@@ -56,11 +56,6 @@ public class AudioFormatConverter {
|
|||||||
public func transform(_ packet: AudioPacket) -> AudioPacket {
|
public func transform(_ packet: AudioPacket) -> AudioPacket {
|
||||||
let inputData = packet.rawAudioData
|
let inputData = packet.rawAudioData
|
||||||
|
|
||||||
// Short-circuit if no conversion needed
|
|
||||||
if sourceFormat.sampleRate == targetFormat.sampleRate {
|
|
||||||
return packet
|
|
||||||
}
|
|
||||||
|
|
||||||
// Calculate frame counts
|
// Calculate frame counts
|
||||||
let inputFrameCount =
|
let inputFrameCount =
|
||||||
inputData.count / Int(sourceFormat.streamDescription.pointee.mBytesPerFrame)
|
inputData.count / Int(sourceFormat.streamDescription.pointee.mBytesPerFrame)
|
||||||
|
|||||||
Reference in New Issue
Block a user