Remove redundant RiffWaveUtils.swift file as its functionality is duplicated in WhisperState and AudioTranscriptionService
This commit is contained in:
parent
36167a8519
commit
a50e4b6ed1
@ -1,14 +0,0 @@
|
||||
import Foundation
|
||||
|
||||
func decodeWaveFile(_ url: URL) throws -> [Float] {
|
||||
let data = try Data(contentsOf: url)
|
||||
let floats = stride(from: 44, to: data.count, by: 2).map {
|
||||
return data[$0..<$0 + 2].withUnsafeBytes {
|
||||
let short = Int16(littleEndian: $0.load(as: Int16.self))
|
||||
return max(-1.0, min(Float(short) / 32767.0, 1.0))
|
||||
}
|
||||
}
|
||||
return floats
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user