This folder demonstrates streaming and one‑shot speech recognition. The scene is SpeechToText/SpeechToTextSample.unity, controlled by SpeechToText/AiliaSpeechToTextSample.cs.
-
Whisper (tiny/small/medium/turbo)
- Purpose: Multilingual speech recognition; turbo variant is a large v3 model.
- Source:
./AiliaSpeechToTextSample.cs - Script behavior: Downloads the encoder/decoder ONNX (and weights PB for turbo), opens with
AiliaSpeechModel.Open(...), and optionally enables live streaming (AILIA_SPEECH_FLAG_LIVE). Uses Silero VAD for endpointing.
-
SenseVoice Small
- Purpose: Alternative end‑to‑end ASR model.
- Source:
./AiliaSpeechToTextSample.cs - Script behavior: Opens SenseVoice encoder ONNX and decoder
.modelpair through the same ailia speech API.
- Models download into
Application.temporaryCachePathunderwhisperorsensevoice. - Silero VAD models (
silero_vad.onnxorsilero_vad_v6_2.onnx) are also downloaded and opened viaOpenVad(..., AILIA_SPEECH_VAD_TYPE_SILERO).
- Microphone input:
- Use
AiliaMicrophoneto capture PCM each frame:GetPcm(ref channels, ref frequency).
- Use
- Speech model init:
- Get environment id:
ailia_speech.GetEnvironmentId(gpuMode). ailia_speech.Open(encoderPath, decoderPath, envId, memoryMode, modelType, task, flags, language).- Optional:
ailia_speech.OpenVad(vadPath, AILIA_SPEECH_VAD_TYPE_SILERO).
- Get environment id:
- Streaming transcribe loop:
- Feed audio chunks with
Transcribe(wave, freq, ch, isFinalize), poll intermediate text viaGetIntermediateText(), and fetch final results viaGetResults().
- Feed audio chunks with
- Sample controller:
./AiliaSpeechToTextSample.cs