This repository has been archived on 2025-08-26. You can view files and clone it, but cannot push or open issues or pull requests.
Files
enginex-mr_series-sherpa-onnx/ios-swiftui/SherpaOnnx/SherpaOnnx/Extension.swift
Fangjun Kuang 9ac747248b Add SwiftUI demo project (#118)
* Commit after creating the project

* Add sherpa-onnx related files

* copy and modify files from sherpa-ncnn

* add app icon
2023-04-05 22:16:29 +08:00

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()
}
}