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
This commit is contained in:
Fangjun Kuang
2023-04-05 22:16:29 +08:00
committed by GitHub
parent ae1f9e7914
commit 9ac747248b
19 changed files with 1097 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
//
// 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()
}
}