df1c5ff32c
Replace MLX GPU inference with CoreML bundles so transcription continues while the host app is backgrounded. Adds model download and warm-up, vendored Qwen3Speech, and updates onboarding, settings, and copy for the ~1.6 GB CoreML package (iOS 18+).
30 lines
936 B
Swift
30 lines
936 B
Swift
import AudioCommon
|
|
|
|
// MARK: - VoiceActivityDetectionModel
|
|
|
|
extension PyannoteVADModel: VoiceActivityDetectionModel {
|
|
public var inputSampleRate: Int { segConfig.sampleRate }
|
|
}
|
|
|
|
// MARK: - SpeakerEmbeddingModel
|
|
|
|
extension WeSpeakerModel: SpeakerEmbeddingModel {}
|
|
|
|
// MARK: - SpeakerDiarizationModel
|
|
|
|
extension PyannoteDiarizationPipeline: SpeakerDiarizationModel {
|
|
public var inputSampleRate: Int { segConfig.sampleRate }
|
|
|
|
public func diarize(audio: [Float], sampleRate: Int) -> [DiarizedSegment] {
|
|
diarize(audio: audio, sampleRate: sampleRate, config: .default).segments
|
|
}
|
|
}
|
|
|
|
// MARK: - SpeakerExtractionCapable
|
|
|
|
extension PyannoteDiarizationPipeline: SpeakerExtractionCapable {
|
|
public func extractSpeaker(audio: [Float], sampleRate: Int, targetEmbedding: [Float]) -> [SpeechSegment] {
|
|
extractSpeaker(audio: audio, sampleRate: sampleRate, targetEmbedding: targetEmbedding, config: .default)
|
|
}
|
|
}
|