Skip to main content

EdgeVoice API reference

EdgeVoice contains audio recording APIs and a Whisper preview bridge.

Current preview boundary

In edge-kit@1.0.0-rc97, WhisperEngine is a skeleton for future whisper.cpp xcframework integration. It does not perform real transcription. Use STTEngine from EdgeInference for runnable native ASR examples in the current preview.

AudioRecorder

@MainActor
public final class AudioRecorder: NSObject, ObservableObject

Records microphone input to a local WAV file.

Property or methodDescription
isRecordingWhether recording is active.
currentLevelCurrent input level.
startRecording()Starts recording and returns the output URL.
stopRecording()Stops recording and returns the final URL if available.

Example:

let recorder = AudioRecorder()
let url = try await recorder.startRecording()
let finalURL = recorder.stopRecording() ?? url

WhisperEngine

@MainActor
public final class WhisperEngine: ObservableObject

Preview bridge for Whisper-family models.

Property or methodDescription
isLoadedWhether a model is loaded.
isTranscribingWhether transcription is active.
load(_:)Records the selected model size for the skeleton bridge.
transcribe(audioURL:language:)Returns a placeholder string until whisper.cpp integration is supplied.
startRealtime(language:)Completes immediately until realtime Whisper integration is supplied.
unload()Releases the loaded model.

WhisperEngine.ModelSize

public enum ModelSize: String, CaseIterable, Sendable
CaseFilename
.tinyggml-tiny.bin
.baseggml-base.bin
.smallggml-small.bin
.mediumggml-medium.bin

TranscriptionResult

public struct TranscriptionResult: Sendable
PropertyType
textString
languageString
durationTimeInterval