* Commit after creating the project * Add sherpa-onnx related files * copy and modify files from sherpa-ncnn * add app icon
21 lines
340 B
Swift
21 lines
340 B
Swift
//
|
|
// Extension.swift
|
|
// SherpaOnnx
|
|
//
|
|
// Created by knight on 2023/4/5.
|
|
//
|
|
|
|
import AVFoundation
|
|
|
|
extension AudioBuffer {
|
|
func array() -> [Float] {
|
|
return Array(UnsafeBufferPointer(self))
|
|
}
|
|
}
|
|
|
|
extension AVAudioPCMBuffer {
|
|
func array() -> [Float] {
|
|
return self.audioBufferList.pointee.mBuffers.array()
|
|
}
|
|
}
|