|
sherpa-onnx C API 1.0
Public C API and C++ wrapper for sherpa-onnx
|
Public C API for sherpa-onnx. More...
#include <stdint.h>Go to the source code of this file.
Classes | |
| struct | SherpaOnnxOnlineTransducerModelConfig |
| Configuration for a streaming transducer model. More... | |
| struct | SherpaOnnxOnlineParaformerModelConfig |
| Configuration for a streaming Paraformer model. More... | |
| struct | SherpaOnnxOnlineZipformer2CtcModelConfig |
| Configuration for a streaming Zipformer2 CTC model. More... | |
| struct | SherpaOnnxOnlineNemoCtcModelConfig |
| Configuration for a streaming NeMo CTC model. More... | |
| struct | SherpaOnnxOnlineToneCtcModelConfig |
| Configuration for a streaming T-One CTC model. More... | |
| struct | SherpaOnnxOnlineModelConfig |
| Model configuration shared by streaming ASR recognizers. More... | |
| struct | SherpaOnnxFeatureConfig |
| Feature extraction settings for ASR. More... | |
| struct | SherpaOnnxOnlineCtcFstDecoderConfig |
| Configuration for HLG/FST-based online CTC decoding. More... | |
| struct | SherpaOnnxOfflineCtcFstDecoderConfig |
| Configuration for HLG/FST-based offline CTC decoding. More... | |
| struct | SherpaOnnxHomophoneReplacerConfig |
| Configuration for homophone replacement. More... | |
| struct | SherpaOnnxOnlineRecognizerConfig |
| Configuration for a streaming ASR recognizer. More... | |
| struct | SherpaOnnxOnlineRecognizerResult |
| Incremental recognition result for a streaming ASR stream. More... | |
| struct | SherpaOnnxOfflineTransducerModelConfig |
| Configuration for a non-streaming transducer model. More... | |
| struct | SherpaOnnxOfflineParaformerModelConfig |
| Configuration for a non-streaming Paraformer model. More... | |
| struct | SherpaOnnxOfflineNemoEncDecCtcModelConfig |
| Configuration for a non-streaming NeMo CTC model. More... | |
| struct | SherpaOnnxOfflineWhisperModelConfig |
| Configuration for a non-streaming Whisper model. More... | |
| struct | SherpaOnnxOfflineCanaryModelConfig |
| Configuration for a Canary model. More... | |
| struct | SherpaOnnxOfflineCohereTranscribeModelConfig |
| Configuration for a Cohere Transcribe model. More... | |
| struct | SherpaOnnxOfflineFireRedAsrModelConfig |
| Configuration for a FireRedAsr encoder/decoder model. More... | |
| struct | SherpaOnnxOfflineFireRedAsrCtcModelConfig |
| Configuration for a FireRedAsr CTC model. More... | |
| struct | SherpaOnnxOfflineMoonshineModelConfig |
| Configuration for a Moonshine model. More... | |
| struct | SherpaOnnxOfflineTdnnModelConfig |
| Configuration for a TDNN model. More... | |
| struct | SherpaOnnxOfflineLMConfig |
| Configuration for an offline language model. More... | |
| struct | SherpaOnnxOfflineSenseVoiceModelConfig |
| Configuration for a SenseVoice model. More... | |
| struct | SherpaOnnxOfflineDolphinModelConfig |
| Configuration for a Dolphin model. More... | |
| struct | SherpaOnnxOfflineZipformerCtcModelConfig |
| Configuration for an offline Zipformer CTC model. More... | |
| struct | SherpaOnnxOfflineWenetCtcModelConfig |
| Configuration for an offline WeNet CTC model. More... | |
| struct | SherpaOnnxOfflineOmnilingualAsrCtcModelConfig |
| Configuration for an omnilingual offline CTC model. More... | |
| struct | SherpaOnnxOfflineFunASRNanoModelConfig |
| Configuration for an offline FunASR Nano model. More... | |
| struct | SherpaOnnxOfflineQwen3ASRModelConfig |
| Configuration for an offline Qwen3-ASR model. More... | |
| struct | SherpaOnnxOfflineMedAsrCtcModelConfig |
| Configuration for a MedASR CTC model. More... | |
| struct | SherpaOnnxOfflineModelConfig |
| Model configuration shared by offline ASR recognizers. More... | |
| struct | SherpaOnnxOfflineRecognizerConfig |
| Configuration for a non-streaming ASR recognizer. More... | |
| struct | SherpaOnnxOfflineRecognizerResult |
| Recognition result for a non-streaming ASR stream. More... | |
| struct | SherpaOnnxKeywordResult |
| Snapshot of the current keyword spotting result. More... | |
| struct | SherpaOnnxKeywordSpotterConfig |
| Configuration for keyword spotting. More... | |
| struct | SherpaOnnxSileroVadModelConfig |
| Configuration for a Silero VAD model. More... | |
| struct | SherpaOnnxTenVadModelConfig |
| Configuration for a Ten VAD model. More... | |
| struct | SherpaOnnxVadModelConfig |
| Configuration shared by voice activity detectors. More... | |
| struct | SherpaOnnxSpeechSegment |
| One detected speech segment returned by the VAD. More... | |
| struct | SherpaOnnxOfflineTtsVitsModelConfig |
| Configuration for a VITS TTS model. More... | |
| struct | SherpaOnnxOfflineTtsMatchaModelConfig |
| Configuration for a Matcha TTS model. More... | |
| struct | SherpaOnnxOfflineTtsKokoroModelConfig |
| Configuration for a Kokoro TTS model. More... | |
| struct | SherpaOnnxOfflineTtsKittenModelConfig |
| Configuration for a Kitten TTS model. More... | |
| struct | SherpaOnnxOfflineTtsZipvoiceModelConfig |
| Configuration for a ZipVoice TTS model. More... | |
| struct | SherpaOnnxOfflineTtsPocketModelConfig |
| Configuration for a Pocket TTS model. More... | |
| struct | SherpaOnnxOfflineTtsSupertonicModelConfig |
| Configuration for a Supertonic TTS model. More... | |
| struct | SherpaOnnxOfflineTtsModelConfig |
| Configuration shared by offline TTS models. More... | |
| struct | SherpaOnnxOfflineTtsConfig |
| Configuration for offline text-to-speech. More... | |
| struct | SherpaOnnxGeneratedAudio |
| Generated waveform returned by TTS APIs. More... | |
| struct | SherpaOnnxGenerationConfig |
| Generation-time parameters shared by advanced TTS APIs. More... | |
| struct | SherpaOnnxForcedAlignmentOptions |
| Options of a forced aligner. A stream can override any of them via its own option mechanism before the alignment is computed. More... | |
| struct | SherpaOnnxForcedAlignerConfig |
| Configuration of a forced aligner. More... | |
| struct | SherpaOnnxForcedAlignmentInterval |
| struct | SherpaOnnxForcedAlignmentTier |
| struct | SherpaOnnxForcedAlignmentResult |
| The result of SherpaOnnxForcedAlignerCompute(). More... | |
| struct | SherpaOnnxWave |
| Decoded mono WAVE file content. More... | |
| struct | SherpaOnnxMultiChannelWave |
| Decoded multi-channel WAVE file content. More... | |
| struct | SherpaOnnxSpokenLanguageIdentificationWhisperConfig |
| Whisper-based model files for spoken language identification. More... | |
| struct | SherpaOnnxSpokenLanguageIdentificationConfig |
| Configuration for spoken language identification. More... | |
| struct | SherpaOnnxSpokenLanguageIdentificationResult |
| Result of spoken-language identification. More... | |
| struct | SherpaOnnxSpeakerEmbeddingExtractorConfig |
| Configuration for speaker embedding extraction. More... | |
| struct | SherpaOnnxSpeakerEmbeddingManagerSpeakerMatch |
| One speaker match returned by the best-matches API. More... | |
| struct | SherpaOnnxSpeakerEmbeddingManagerBestMatchesResult |
| Collection of best speaker matches. More... | |
| struct | SherpaOnnxOfflineZipformerAudioTaggingModelConfig |
| Zipformer audio-tagging model configuration. More... | |
| struct | SherpaOnnxAudioTaggingModelConfig |
| Audio-tagging model configuration. More... | |
| struct | SherpaOnnxAudioTaggingConfig |
| Configuration for audio tagging. More... | |
| struct | SherpaOnnxAudioEvent |
| One audio-tagging prediction. More... | |
| struct | SherpaOnnxOfflinePunctuationModelConfig |
| Offline punctuation model configuration. More... | |
| struct | SherpaOnnxOfflinePunctuationConfig |
| Configuration for offline punctuation. More... | |
| struct | SherpaOnnxOnlinePunctuationModelConfig |
| Online punctuation model configuration. More... | |
| struct | SherpaOnnxOnlinePunctuationConfig |
| Configuration for online punctuation. More... | |
| struct | SherpaOnnxResampleOut |
| Output chunk returned by SherpaOnnxLinearResamplerResample(). More... | |
| struct | SherpaOnnxOfflineSpeakerSegmentationPyannoteModelConfig |
| Pyannote speaker-segmentation model configuration. More... | |
| struct | SherpaOnnxOfflineSpeakerSegmentationModelConfig |
| Segmentation model configuration for offline speaker diarization. More... | |
| struct | SherpaOnnxFastClusteringConfig |
| Fast clustering configuration. More... | |
| struct | SherpaOnnxOfflineSpeakerDiarizationConfig |
| Configuration for offline speaker diarization. More... | |
| struct | SherpaOnnxOfflineSpeakerDiarizationSegment |
| One diarization segment. More... | |
| struct | SherpaOnnxOfflineSpeechDenoiserGtcrnModelConfig |
| GTCRN offline denoiser model configuration. More... | |
| struct | SherpaOnnxOfflineSpeechDenoiserDpdfNetModelConfig |
| DPDFNet offline denoiser model configuration. More... | |
| struct | SherpaOnnxOfflineSpeechDenoiserVoxLockModelConfig |
| VoxLock target-speaker voice isolation model configuration. More... | |
| struct | SherpaOnnxOfflineSpeechDenoiserModelConfig |
| Speech denoiser model configuration shared by offline and online APIs. More... | |
| struct | SherpaOnnxOfflineSpeechDenoiserConfig |
| Configuration for offline speech denoising. More... | |
| struct | SherpaOnnxDenoisedAudio |
| Denoised audio returned by offline or online speech enhancement APIs. More... | |
| struct | SherpaOnnxOnlineSpeechDenoiserConfig |
| Configuration for streaming speech denoising. More... | |
| struct | SherpaOnnxOfflineSourceSeparationSpleeterModelConfig |
| Spleeter source-separation model configuration. More... | |
| struct | SherpaOnnxOfflineSourceSeparationUvrModelConfig |
| UVR (MDX-Net) source-separation model configuration. More... | |
| struct | SherpaOnnxOfflineSourceSeparationModelConfig |
| Source-separation model configuration. More... | |
| struct | SherpaOnnxOfflineSourceSeparationConfig |
| Top-level source-separation configuration. More... | |
| struct | SherpaOnnxSourceSeparationStem |
| A single stem (one output track) with one or more channels. More... | |
| struct | SherpaOnnxSourceSeparationOutput |
| Output of a source-separation run. More... | |
| struct | SherpaOnnxOfflineDiacritizationModelConfig |
| Offline diacritization model configuration. More... | |
| struct | SherpaOnnxOfflineDiacritizationConfig |
| Configuration for offline diacritization. More... | |
Macros | |
| #define | SHERPA_ONNX_EXPORT __attribute__((visibility("default"))) |
| #define | SHERPA_ONNX_IMPORT SHERPA_ONNX_EXPORT |
| #define | SHERPA_ONNX_API SHERPA_ONNX_IMPORT |
Typedefs | |
| typedef struct SherpaOnnxOnlineTransducerModelConfig | SherpaOnnxOnlineTransducerModelConfig |
| Configuration for a streaming transducer model. | |
| typedef struct SherpaOnnxOnlineParaformerModelConfig | SherpaOnnxOnlineParaformerModelConfig |
| Configuration for a streaming Paraformer model. | |
| typedef struct SherpaOnnxOnlineZipformer2CtcModelConfig | SherpaOnnxOnlineZipformer2CtcModelConfig |
| Configuration for a streaming Zipformer2 CTC model. | |
| typedef struct SherpaOnnxOnlineNemoCtcModelConfig | SherpaOnnxOnlineNemoCtcModelConfig |
| Configuration for a streaming NeMo CTC model. | |
| typedef struct SherpaOnnxOnlineToneCtcModelConfig | SherpaOnnxOnlineToneCtcModelConfig |
| Configuration for a streaming T-One CTC model. | |
| typedef struct SherpaOnnxOnlineModelConfig | SherpaOnnxOnlineModelConfig |
| Model configuration shared by streaming ASR recognizers. | |
| typedef struct SherpaOnnxFeatureConfig | SherpaOnnxFeatureConfig |
| Feature extraction settings for ASR. | |
| typedef struct SherpaOnnxOnlineCtcFstDecoderConfig | SherpaOnnxOnlineCtcFstDecoderConfig |
| Configuration for HLG/FST-based online CTC decoding. | |
| typedef struct SherpaOnnxOfflineCtcFstDecoderConfig | SherpaOnnxOfflineCtcFstDecoderConfig |
| Configuration for HLG/FST-based offline CTC decoding. | |
| typedef struct SherpaOnnxHomophoneReplacerConfig | SherpaOnnxHomophoneReplacerConfig |
| Configuration for homophone replacement. | |
| typedef struct SherpaOnnxOnlineRecognizerConfig | SherpaOnnxOnlineRecognizerConfig |
| Configuration for a streaming ASR recognizer. | |
| typedef struct SherpaOnnxOnlineRecognizerResult | SherpaOnnxOnlineRecognizerResult |
| Incremental recognition result for a streaming ASR stream. | |
| typedef struct SherpaOnnxOnlineRecognizer | SherpaOnnxOnlineRecognizer |
| Streaming recognizer handle. | |
| typedef struct SherpaOnnxOnlineStream | SherpaOnnxOnlineStream |
| Streaming decoding state for one utterance or stream. | |
| typedef struct SherpaOnnxDisplay | SherpaOnnxDisplay |
| Helper for pretty-printing incremental recognition results. | |
| typedef struct SherpaOnnxOfflineTransducerModelConfig | SherpaOnnxOfflineTransducerModelConfig |
| Configuration for a non-streaming transducer model. | |
| typedef struct SherpaOnnxOfflineParaformerModelConfig | SherpaOnnxOfflineParaformerModelConfig |
| Configuration for a non-streaming Paraformer model. | |
| typedef struct SherpaOnnxOfflineNemoEncDecCtcModelConfig | SherpaOnnxOfflineNemoEncDecCtcModelConfig |
| Configuration for a non-streaming NeMo CTC model. | |
| typedef struct SherpaOnnxOfflineWhisperModelConfig | SherpaOnnxOfflineWhisperModelConfig |
| Configuration for a non-streaming Whisper model. | |
| typedef struct SherpaOnnxOfflineCanaryModelConfig | SherpaOnnxOfflineCanaryModelConfig |
| Configuration for a Canary model. | |
| typedef struct SherpaOnnxOfflineCohereTranscribeModelConfig | SherpaOnnxOfflineCohereTranscribeModelConfig |
| Configuration for a Cohere Transcribe model. | |
| typedef struct SherpaOnnxOfflineFireRedAsrModelConfig | SherpaOnnxOfflineFireRedAsrModelConfig |
| Configuration for a FireRedAsr encoder/decoder model. | |
| typedef struct SherpaOnnxOfflineFireRedAsrCtcModelConfig | SherpaOnnxOfflineFireRedAsrCtcModelConfig |
| Configuration for a FireRedAsr CTC model. | |
| typedef struct SherpaOnnxOfflineMoonshineModelConfig | SherpaOnnxOfflineMoonshineModelConfig |
| Configuration for a Moonshine model. | |
| typedef struct SherpaOnnxOfflineTdnnModelConfig | SherpaOnnxOfflineTdnnModelConfig |
| Configuration for a TDNN model. | |
| typedef struct SherpaOnnxOfflineLMConfig | SherpaOnnxOfflineLMConfig |
| Configuration for an offline language model. | |
| typedef struct SherpaOnnxOfflineSenseVoiceModelConfig | SherpaOnnxOfflineSenseVoiceModelConfig |
| Configuration for a SenseVoice model. | |
| typedef struct SherpaOnnxOfflineDolphinModelConfig | SherpaOnnxOfflineDolphinModelConfig |
| Configuration for a Dolphin model. | |
| typedef struct SherpaOnnxOfflineZipformerCtcModelConfig | SherpaOnnxOfflineZipformerCtcModelConfig |
| Configuration for an offline Zipformer CTC model. | |
| typedef struct SherpaOnnxOfflineWenetCtcModelConfig | SherpaOnnxOfflineWenetCtcModelConfig |
| Configuration for an offline WeNet CTC model. | |
| typedef struct SherpaOnnxOfflineOmnilingualAsrCtcModelConfig | SherpaOnnxOfflineOmnilingualAsrCtcModelConfig |
| Configuration for an omnilingual offline CTC model. | |
| typedef struct SherpaOnnxOfflineFunASRNanoModelConfig | SherpaOnnxOfflineFunASRNanoModelConfig |
| Configuration for an offline FunASR Nano model. | |
| typedef struct SherpaOnnxOfflineQwen3ASRModelConfig | SherpaOnnxOfflineQwen3ASRModelConfig |
| Configuration for an offline Qwen3-ASR model. | |
| typedef struct SherpaOnnxOfflineMedAsrCtcModelConfig | SherpaOnnxOfflineMedAsrCtcModelConfig |
| Configuration for a MedASR CTC model. | |
| typedef struct SherpaOnnxOfflineModelConfig | SherpaOnnxOfflineModelConfig |
| Model configuration shared by offline ASR recognizers. | |
| typedef struct SherpaOnnxOfflineRecognizerConfig | SherpaOnnxOfflineRecognizerConfig |
| Configuration for a non-streaming ASR recognizer. | |
| typedef struct SherpaOnnxOfflineRecognizer | SherpaOnnxOfflineRecognizer |
| Non-streaming recognizer handle. | |
| typedef struct SherpaOnnxOfflineStream | SherpaOnnxOfflineStream |
| Non-streaming decoding state for one utterance. | |
| typedef struct SherpaOnnxOfflineRecognizerResult | SherpaOnnxOfflineRecognizerResult |
| Recognition result for a non-streaming ASR stream. | |
| typedef struct SherpaOnnxKeywordResult | SherpaOnnxKeywordResult |
| Snapshot of the current keyword spotting result. | |
| typedef struct SherpaOnnxKeywordSpotterConfig | SherpaOnnxKeywordSpotterConfig |
| Configuration for keyword spotting. | |
| typedef struct SherpaOnnxKeywordSpotter | SherpaOnnxKeywordSpotter |
| Opaque keyword spotter handle. | |
| typedef struct SherpaOnnxSileroVadModelConfig | SherpaOnnxSileroVadModelConfig |
| Configuration for a Silero VAD model. | |
| typedef struct SherpaOnnxTenVadModelConfig | SherpaOnnxTenVadModelConfig |
| Configuration for a Ten VAD model. | |
| typedef struct SherpaOnnxVadModelConfig | SherpaOnnxVadModelConfig |
| Configuration shared by voice activity detectors. | |
| typedef struct SherpaOnnxCircularBuffer | SherpaOnnxCircularBuffer |
| Opaque circular-buffer handle used by helper APIs. | |
| typedef struct SherpaOnnxSpeechSegment | SherpaOnnxSpeechSegment |
| One detected speech segment returned by the VAD. | |
| typedef struct SherpaOnnxVoiceActivityDetector | SherpaOnnxVoiceActivityDetector |
| Opaque voice activity detector handle. | |
| typedef struct SherpaOnnxOfflineTtsVitsModelConfig | SherpaOnnxOfflineTtsVitsModelConfig |
| Configuration for a VITS TTS model. | |
| typedef struct SherpaOnnxOfflineTtsMatchaModelConfig | SherpaOnnxOfflineTtsMatchaModelConfig |
| Configuration for a Matcha TTS model. | |
| typedef struct SherpaOnnxOfflineTtsKokoroModelConfig | SherpaOnnxOfflineTtsKokoroModelConfig |
| Configuration for a Kokoro TTS model. | |
| typedef struct SherpaOnnxOfflineTtsKittenModelConfig | SherpaOnnxOfflineTtsKittenModelConfig |
| Configuration for a Kitten TTS model. | |
| typedef struct SherpaOnnxOfflineTtsZipvoiceModelConfig | SherpaOnnxOfflineTtsZipvoiceModelConfig |
| Configuration for a ZipVoice TTS model. | |
| typedef struct SherpaOnnxOfflineTtsPocketModelConfig | SherpaOnnxOfflineTtsPocketModelConfig |
| Configuration for a Pocket TTS model. | |
| typedef struct SherpaOnnxOfflineTtsSupertonicModelConfig | SherpaOnnxOfflineTtsSupertonicModelConfig |
| Configuration for a Supertonic TTS model. | |
| typedef struct SherpaOnnxOfflineTtsModelConfig | SherpaOnnxOfflineTtsModelConfig |
| Configuration shared by offline TTS models. | |
| typedef struct SherpaOnnxOfflineTtsConfig | SherpaOnnxOfflineTtsConfig |
| Configuration for offline text-to-speech. | |
| typedef struct SherpaOnnxGeneratedAudio | SherpaOnnxGeneratedAudio |
| Generated waveform returned by TTS APIs. | |
| typedef int32_t(* | SherpaOnnxGeneratedAudioCallback) (const float *samples, int32_t n) |
| Callback invoked during incremental generation. | |
| typedef int32_t(* | SherpaOnnxGeneratedAudioCallbackWithArg) (const float *samples, int32_t n, void *arg) |
| Same as SherpaOnnxGeneratedAudioCallback but with an extra user pointer. | |
| typedef int32_t(* | SherpaOnnxGeneratedAudioProgressCallback) (const float *samples, int32_t n, float p) |
| Progress callback invoked during incremental generation. | |
| typedef int32_t(* | SherpaOnnxGeneratedAudioProgressCallbackWithArg) (const float *samples, int32_t n, float p, void *arg) |
| Same as SherpaOnnxGeneratedAudioProgressCallback but with an extra user pointer. | |
| typedef struct SherpaOnnxOfflineTts | SherpaOnnxOfflineTts |
| Opaque offline TTS handle. | |
| typedef struct SherpaOnnxGenerationConfig | SherpaOnnxGenerationConfig |
| Generation-time parameters shared by advanced TTS APIs. | |
| typedef struct SherpaOnnxForcedAligner | SherpaOnnxForcedAligner |
| Opaque forced aligner object. | |
| typedef struct SherpaOnnxForcedAlignmentOptions | SherpaOnnxForcedAlignmentOptions |
| Options of a forced aligner. A stream can override any of them via its own option mechanism before the alignment is computed. | |
| typedef struct SherpaOnnxForcedAlignerConfig | SherpaOnnxForcedAlignerConfig |
| Configuration of a forced aligner. | |
| typedef struct SherpaOnnxForcedAlignmentInterval | SherpaOnnxForcedAlignmentInterval |
| typedef struct SherpaOnnxForcedAlignmentTier | SherpaOnnxForcedAlignmentTier |
| typedef struct SherpaOnnxForcedAlignmentResult | SherpaOnnxForcedAlignmentResult |
| The result of SherpaOnnxForcedAlignerCompute(). | |
| typedef struct SherpaOnnxWave | SherpaOnnxWave |
| Decoded mono WAVE file content. | |
| typedef struct SherpaOnnxMultiChannelWave | SherpaOnnxMultiChannelWave |
| Decoded multi-channel WAVE file content. | |
| typedef struct SherpaOnnxSpokenLanguageIdentificationWhisperConfig | SherpaOnnxSpokenLanguageIdentificationWhisperConfig |
| Whisper-based model files for spoken language identification. | |
| typedef struct SherpaOnnxSpokenLanguageIdentificationConfig | SherpaOnnxSpokenLanguageIdentificationConfig |
| Configuration for spoken language identification. | |
| typedef struct SherpaOnnxSpokenLanguageIdentification | SherpaOnnxSpokenLanguageIdentification |
| Opaque spoken-language identification handle. | |
| typedef struct SherpaOnnxSpokenLanguageIdentificationResult | SherpaOnnxSpokenLanguageIdentificationResult |
| Result of spoken-language identification. | |
| typedef struct SherpaOnnxSpeakerEmbeddingExtractorConfig | SherpaOnnxSpeakerEmbeddingExtractorConfig |
| Configuration for speaker embedding extraction. | |
| typedef struct SherpaOnnxSpeakerEmbeddingExtractor | SherpaOnnxSpeakerEmbeddingExtractor |
| Opaque speaker embedding extractor handle. | |
| typedef struct SherpaOnnxSpeakerEmbeddingManager | SherpaOnnxSpeakerEmbeddingManager |
| Opaque speaker embedding manager handle. | |
| typedef struct SherpaOnnxSpeakerEmbeddingManagerSpeakerMatch | SherpaOnnxSpeakerEmbeddingManagerSpeakerMatch |
| One speaker match returned by the best-matches API. | |
| typedef struct SherpaOnnxSpeakerEmbeddingManagerBestMatchesResult | SherpaOnnxSpeakerEmbeddingManagerBestMatchesResult |
| Collection of best speaker matches. | |
| typedef struct SherpaOnnxOfflineZipformerAudioTaggingModelConfig | SherpaOnnxOfflineZipformerAudioTaggingModelConfig |
| Zipformer audio-tagging model configuration. | |
| typedef struct SherpaOnnxAudioTaggingModelConfig | SherpaOnnxAudioTaggingModelConfig |
| Audio-tagging model configuration. | |
| typedef struct SherpaOnnxAudioTaggingConfig | SherpaOnnxAudioTaggingConfig |
| Configuration for audio tagging. | |
| typedef struct SherpaOnnxAudioEvent | SherpaOnnxAudioEvent |
| One audio-tagging prediction. | |
| typedef struct SherpaOnnxAudioTagging | SherpaOnnxAudioTagging |
| Opaque audio tagger handle. | |
| typedef struct SherpaOnnxOfflinePunctuationModelConfig | SherpaOnnxOfflinePunctuationModelConfig |
| Offline punctuation model configuration. | |
| typedef struct SherpaOnnxOfflinePunctuationConfig | SherpaOnnxOfflinePunctuationConfig |
| Configuration for offline punctuation. | |
| typedef struct SherpaOnnxOfflinePunctuation | SherpaOnnxOfflinePunctuation |
| Opaque offline punctuation handle. | |
| typedef struct SherpaOnnxOnlinePunctuationModelConfig | SherpaOnnxOnlinePunctuationModelConfig |
| Online punctuation model configuration. | |
| typedef struct SherpaOnnxOnlinePunctuationConfig | SherpaOnnxOnlinePunctuationConfig |
| Configuration for online punctuation. | |
| typedef struct SherpaOnnxOnlinePunctuation | SherpaOnnxOnlinePunctuation |
| Opaque online punctuation handle. | |
| typedef struct SherpaOnnxLinearResampler | SherpaOnnxLinearResampler |
| Opaque linear resampler handle. | |
| typedef struct SherpaOnnxResampleOut | SherpaOnnxResampleOut |
| Output chunk returned by SherpaOnnxLinearResamplerResample(). | |
| typedef struct SherpaOnnxOfflineSpeakerSegmentationPyannoteModelConfig | SherpaOnnxOfflineSpeakerSegmentationPyannoteModelConfig |
| Pyannote speaker-segmentation model configuration. | |
| typedef struct SherpaOnnxOfflineSpeakerSegmentationModelConfig | SherpaOnnxOfflineSpeakerSegmentationModelConfig |
| Segmentation model configuration for offline speaker diarization. | |
| typedef struct SherpaOnnxFastClusteringConfig | SherpaOnnxFastClusteringConfig |
| Fast clustering configuration. | |
| typedef struct SherpaOnnxOfflineSpeakerDiarizationConfig | SherpaOnnxOfflineSpeakerDiarizationConfig |
| Configuration for offline speaker diarization. | |
| typedef struct SherpaOnnxOfflineSpeakerDiarization | SherpaOnnxOfflineSpeakerDiarization |
| Opaque offline speaker diarization handle. | |
| typedef struct SherpaOnnxOfflineSpeakerDiarizationResult | SherpaOnnxOfflineSpeakerDiarizationResult |
| Opaque offline speaker diarization result. | |
| typedef struct SherpaOnnxOfflineSpeakerDiarizationSegment | SherpaOnnxOfflineSpeakerDiarizationSegment |
| One diarization segment. | |
| typedef int32_t(* | SherpaOnnxOfflineSpeakerDiarizationProgressCallback) (int32_t num_processed_chunks, int32_t num_total_chunks, void *arg) |
| Progress callback for offline speaker diarization. | |
| typedef int32_t(* | SherpaOnnxOfflineSpeakerDiarizationProgressCallbackNoArg) (int32_t num_processed_chunks, int32_t num_total_chunks) |
| Same as SherpaOnnxOfflineSpeakerDiarizationProgressCallback but without a user pointer. | |
| typedef struct SherpaOnnxOfflineSpeechDenoiserGtcrnModelConfig | SherpaOnnxOfflineSpeechDenoiserGtcrnModelConfig |
| GTCRN offline denoiser model configuration. | |
| typedef struct SherpaOnnxOfflineSpeechDenoiserDpdfNetModelConfig | SherpaOnnxOfflineSpeechDenoiserDpdfNetModelConfig |
| DPDFNet offline denoiser model configuration. | |
| typedef struct SherpaOnnxOfflineSpeechDenoiserVoxLockModelConfig | SherpaOnnxOfflineSpeechDenoiserVoxLockModelConfig |
| VoxLock target-speaker voice isolation model configuration. | |
| typedef struct SherpaOnnxOfflineSpeechDenoiserModelConfig | SherpaOnnxOfflineSpeechDenoiserModelConfig |
| Speech denoiser model configuration shared by offline and online APIs. | |
| typedef struct SherpaOnnxOfflineSpeechDenoiserConfig | SherpaOnnxOfflineSpeechDenoiserConfig |
| Configuration for offline speech denoising. | |
| typedef struct SherpaOnnxOfflineSpeechDenoiser | SherpaOnnxOfflineSpeechDenoiser |
| Opaque offline speech denoiser handle. | |
| typedef struct SherpaOnnxDenoisedAudio | SherpaOnnxDenoisedAudio |
| Denoised audio returned by offline or online speech enhancement APIs. | |
| typedef struct SherpaOnnxOnlineSpeechDenoiserConfig | SherpaOnnxOnlineSpeechDenoiserConfig |
| Configuration for streaming speech denoising. | |
| typedef struct SherpaOnnxOnlineSpeechDenoiser | SherpaOnnxOnlineSpeechDenoiser |
| Opaque online speech denoiser handle. | |
| typedef struct SherpaOnnxOfflineSourceSeparationSpleeterModelConfig | SherpaOnnxOfflineSourceSeparationSpleeterModelConfig |
| Spleeter source-separation model configuration. | |
| typedef struct SherpaOnnxOfflineSourceSeparationUvrModelConfig | SherpaOnnxOfflineSourceSeparationUvrModelConfig |
| UVR (MDX-Net) source-separation model configuration. | |
| typedef struct SherpaOnnxOfflineSourceSeparationModelConfig | SherpaOnnxOfflineSourceSeparationModelConfig |
| Source-separation model configuration. | |
| typedef struct SherpaOnnxOfflineSourceSeparationConfig | SherpaOnnxOfflineSourceSeparationConfig |
| Top-level source-separation configuration. | |
| typedef struct SherpaOnnxOfflineSourceSeparation | SherpaOnnxOfflineSourceSeparation |
| Opaque source-separation engine handle. | |
| typedef struct SherpaOnnxSourceSeparationStem | SherpaOnnxSourceSeparationStem |
| A single stem (one output track) with one or more channels. | |
| typedef struct SherpaOnnxSourceSeparationOutput | SherpaOnnxSourceSeparationOutput |
| Output of a source-separation run. | |
| typedef struct SherpaOnnxOfflineDiacritizationModelConfig | SherpaOnnxOfflineDiacritizationModelConfig |
| Offline diacritization model configuration. | |
| typedef struct SherpaOnnxOfflineDiacritizationConfig | SherpaOnnxOfflineDiacritizationConfig |
| Configuration for offline diacritization. | |
| typedef struct SherpaOnnxOfflineDiacritization | SherpaOnnxOfflineDiacritization |
| Opaque offline diacritization handle. | |
Functions | |
| const char * | SherpaOnnxGetVersionStr () |
| Return the sherpa-onnx version string. | |
| const char * | SherpaOnnxGetGitSha1 () |
| Return the Git SHA1 used to build the library. | |
| const char * | SherpaOnnxGetGitDate () |
| Return the Git build date used to build the library. | |
| const char * | SherpaOnnxGetOnnxruntimeVersionStr () |
| Return the onnxruntime version string used by the library. | |
| int32_t | SherpaOnnxFileExists (const char *filename) |
| Check whether a file exists. | |
| const SherpaOnnxOnlineRecognizer * | SherpaOnnxCreateOnlineRecognizer (const SherpaOnnxOnlineRecognizerConfig *config) |
| Create a streaming ASR recognizer. | |
| void | SherpaOnnxDestroyOnlineRecognizer (const SherpaOnnxOnlineRecognizer *recognizer) |
| Destroy a streaming recognizer. | |
| const SherpaOnnxOnlineStream * | SherpaOnnxCreateOnlineStream (const SherpaOnnxOnlineRecognizer *recognizer) |
| Create a streaming ASR state object. | |
| const SherpaOnnxOnlineStream * | SherpaOnnxCreateOnlineStreamWithHotwords (const SherpaOnnxOnlineRecognizer *recognizer, const char *hotwords) |
| Create a streaming ASR state object with per-stream hotwords. | |
| void | SherpaOnnxDestroyOnlineStream (const SherpaOnnxOnlineStream *stream) |
| Destroy a streaming ASR state object. | |
| void | SherpaOnnxOnlineStreamAcceptWaveform (const SherpaOnnxOnlineStream *stream, int32_t sample_rate, const float *samples, int32_t n) |
| Append audio samples to a streaming ASR stream. | |
| int32_t | SherpaOnnxIsOnlineStreamReady (const SherpaOnnxOnlineRecognizer *recognizer, const SherpaOnnxOnlineStream *stream) |
| Check whether a streaming ASR stream is ready to decode. | |
| void | SherpaOnnxDecodeOnlineStream (const SherpaOnnxOnlineRecognizer *recognizer, const SherpaOnnxOnlineStream *stream) |
| Decode one step of a streaming ASR stream. | |
| void | SherpaOnnxDecodeMultipleOnlineStreams (const SherpaOnnxOnlineRecognizer *recognizer, const SherpaOnnxOnlineStream **streams, int32_t n) |
| Decode multiple streaming ASR streams in parallel. | |
| const SherpaOnnxOnlineRecognizerResult * | SherpaOnnxGetOnlineStreamResult (const SherpaOnnxOnlineRecognizer *recognizer, const SherpaOnnxOnlineStream *stream) |
| Get the current streaming ASR result for a stream. | |
| void | SherpaOnnxDestroyOnlineRecognizerResult (const SherpaOnnxOnlineRecognizerResult *r) |
| Destroy a result returned by SherpaOnnxGetOnlineStreamResult(). | |
| const char * | SherpaOnnxGetOnlineStreamResultAsJson (const SherpaOnnxOnlineRecognizer *recognizer, const SherpaOnnxOnlineStream *stream) |
| Get the current streaming ASR result as JSON. | |
| void | SherpaOnnxDestroyOnlineStreamResultJson (const char *s) |
| Free a JSON string returned by SherpaOnnxGetOnlineStreamResultAsJson(). | |
| void | SherpaOnnxOnlineStreamReset (const SherpaOnnxOnlineRecognizer *recognizer, const SherpaOnnxOnlineStream *stream) |
| Reset a streaming ASR stream after an endpoint or utterance boundary. | |
| void | SherpaOnnxOnlineStreamInputFinished (const SherpaOnnxOnlineStream *stream) |
| Signal end-of-input for a streaming ASR stream. | |
| void | SherpaOnnxOnlineStreamSetOption (const SherpaOnnxOnlineStream *stream, const char *key, const char *value) |
| Set a per-stream runtime option. | |
| const char * | SherpaOnnxOnlineStreamGetOption (const SherpaOnnxOnlineStream *stream, const char *key) |
| Get a per-stream runtime option. | |
| int32_t | SherpaOnnxOnlineStreamHasOption (const SherpaOnnxOnlineStream *stream, const char *key) |
| Check whether a per-stream runtime option exists. | |
| int32_t | SherpaOnnxOnlineStreamIsEndpoint (const SherpaOnnxOnlineRecognizer *recognizer, const SherpaOnnxOnlineStream *stream) |
| Check whether endpoint detection has triggered for a stream. | |
| const SherpaOnnxDisplay * | SherpaOnnxCreateDisplay (int32_t max_word_per_line) |
| Create a display helper. | |
| void | SherpaOnnxDestroyDisplay (const SherpaOnnxDisplay *display) |
| Destroy a display helper. | |
| void | SherpaOnnxPrint (const SherpaOnnxDisplay *display, int32_t idx, const char *s) |
| Print one line of text using the display helper. | |
| const SherpaOnnxOfflineRecognizer * | SherpaOnnxCreateOfflineRecognizer (const SherpaOnnxOfflineRecognizerConfig *config) |
| Create a non-streaming ASR recognizer. | |
| void | SherpaOnnxOfflineRecognizerSetConfig (const SherpaOnnxOfflineRecognizer *recognizer, const SherpaOnnxOfflineRecognizerConfig *config) |
| Update the configuration of an existing offline recognizer. | |
| void | SherpaOnnxDestroyOfflineRecognizer (const SherpaOnnxOfflineRecognizer *recognizer) |
| Destroy a non-streaming recognizer. | |
| const SherpaOnnxOfflineStream * | SherpaOnnxCreateOfflineStream (const SherpaOnnxOfflineRecognizer *recognizer) |
| Create a non-streaming ASR input stream. | |
| const SherpaOnnxOfflineStream * | SherpaOnnxCreateOfflineStreamWithHotwords (const SherpaOnnxOfflineRecognizer *recognizer, const char *hotwords) |
| Create a non-streaming ASR input stream with per-stream hotwords. | |
| void | SherpaOnnxDestroyOfflineStream (const SherpaOnnxOfflineStream *stream) |
| Destroy a non-streaming ASR stream. | |
| void | SherpaOnnxAcceptWaveformOffline (const SherpaOnnxOfflineStream *stream, int32_t sample_rate, const float *samples, int32_t n) |
| Provide the full utterance to an offline ASR stream. | |
| void | SherpaOnnxOfflineStreamSetOption (const SherpaOnnxOfflineStream *stream, const char *key, const char *value) |
| Set a per-stream runtime option for offline ASR. | |
| const char * | SherpaOnnxOfflineStreamGetOption (const SherpaOnnxOfflineStream *stream, const char *key) |
| Get a per-stream runtime option for offline ASR. | |
| int32_t | SherpaOnnxOfflineStreamHasOption (const SherpaOnnxOfflineStream *stream, const char *key) |
| Check whether a per-stream runtime option exists. | |
| void | SherpaOnnxDecodeOfflineStream (const SherpaOnnxOfflineRecognizer *recognizer, const SherpaOnnxOfflineStream *stream) |
| Run offline ASR on one stream. | |
| void | SherpaOnnxDecodeMultipleOfflineStreams (const SherpaOnnxOfflineRecognizer *recognizer, const SherpaOnnxOfflineStream **streams, int32_t n) |
| Run offline ASR on multiple streams in parallel. | |
| const SherpaOnnxOfflineRecognizerResult * | SherpaOnnxGetOfflineStreamResult (const SherpaOnnxOfflineStream *stream) |
| Get the recognition result for an offline ASR stream. | |
| void | SherpaOnnxDestroyOfflineRecognizerResult (const SherpaOnnxOfflineRecognizerResult *r) |
| Destroy a result returned by SherpaOnnxGetOfflineStreamResult(). | |
| const char * | SherpaOnnxGetOfflineStreamResultAsJson (const SherpaOnnxOfflineStream *stream) |
| Get the offline ASR result as JSON. | |
| void | SherpaOnnxDestroyOfflineStreamResultJson (const char *s) |
| Free a JSON string returned by SherpaOnnxGetOfflineStreamResultAsJson(). | |
| const SherpaOnnxKeywordSpotter * | SherpaOnnxCreateKeywordSpotter (const SherpaOnnxKeywordSpotterConfig *config) |
| Create a keyword spotter. | |
| void | SherpaOnnxDestroyKeywordSpotter (const SherpaOnnxKeywordSpotter *spotter) |
| Destroy a keyword spotter. | |
| const SherpaOnnxOnlineStream * | SherpaOnnxCreateKeywordStream (const SherpaOnnxKeywordSpotter *spotter) |
| Create a keyword spotting stream using the spotter's built-in keyword list. | |
| const SherpaOnnxOnlineStream * | SherpaOnnxCreateKeywordStreamWithKeywords (const SherpaOnnxKeywordSpotter *spotter, const char *keywords) |
| Create a keyword spotting stream with extra or replacement keywords. | |
| int32_t | SherpaOnnxIsKeywordStreamReady (const SherpaOnnxKeywordSpotter *spotter, const SherpaOnnxOnlineStream *stream) |
| Check whether a keyword stream has enough audio for decoding. | |
| void | SherpaOnnxDecodeKeywordStream (const SherpaOnnxKeywordSpotter *spotter, const SherpaOnnxOnlineStream *stream) |
| Decode one ready keyword stream. | |
| void | SherpaOnnxResetKeywordStream (const SherpaOnnxKeywordSpotter *spotter, const SherpaOnnxOnlineStream *stream) |
| Reset a keyword stream after a keyword is detected. | |
| void | SherpaOnnxDecodeMultipleKeywordStreams (const SherpaOnnxKeywordSpotter *spotter, const SherpaOnnxOnlineStream **streams, int32_t n) |
| Decode multiple ready keyword streams in parallel. | |
| const SherpaOnnxKeywordResult * | SherpaOnnxGetKeywordResult (const SherpaOnnxKeywordSpotter *spotter, const SherpaOnnxOnlineStream *stream) |
| Get the current keyword spotting result for a stream. | |
| void | SherpaOnnxDestroyKeywordResult (const SherpaOnnxKeywordResult *r) |
| Destroy a keyword result snapshot. | |
| const char * | SherpaOnnxGetKeywordResultAsJson (const SherpaOnnxKeywordSpotter *spotter, const SherpaOnnxOnlineStream *stream) |
| Get the current keyword spotting result as JSON. | |
| void | SherpaOnnxFreeKeywordResultJson (const char *s) |
| Free a JSON string returned by SherpaOnnxGetKeywordResultAsJson(). | |
| const SherpaOnnxCircularBuffer * | SherpaOnnxCreateCircularBuffer (int32_t capacity) |
| Create a floating-point circular buffer. | |
| void | SherpaOnnxDestroyCircularBuffer (const SherpaOnnxCircularBuffer *buffer) |
| Destroy a circular buffer. | |
| void | SherpaOnnxCircularBufferPush (const SherpaOnnxCircularBuffer *buffer, const float *p, int32_t n) |
| Append samples to a circular buffer. | |
| const float * | SherpaOnnxCircularBufferGet (const SherpaOnnxCircularBuffer *buffer, int64_t start_index, int32_t n) |
| Copy out a slice of samples from a circular buffer. | |
| void | SherpaOnnxCircularBufferFree (const float *p) |
| Free an array returned by SherpaOnnxCircularBufferGet(). | |
| void | SherpaOnnxCircularBufferPop (const SherpaOnnxCircularBuffer *buffer, int32_t n) |
| Drop samples from the front of a circular buffer. | |
| int32_t | SherpaOnnxCircularBufferSize (const SherpaOnnxCircularBuffer *buffer) |
| Return the number of currently stored samples. | |
| int64_t | SherpaOnnxCircularBufferHead (const SherpaOnnxCircularBuffer *buffer) |
| Return the current head index of the buffer timeline. | |
| void | SherpaOnnxCircularBufferReset (const SherpaOnnxCircularBuffer *buffer) |
| Clear a circular buffer and reset its head index. | |
| const SherpaOnnxVoiceActivityDetector * | SherpaOnnxCreateVoiceActivityDetector (const SherpaOnnxVadModelConfig *config, float buffer_size_in_seconds) |
| Create a voice activity detector. | |
| void | SherpaOnnxDestroyVoiceActivityDetector (const SherpaOnnxVoiceActivityDetector *p) |
| Destroy a voice activity detector. | |
| void | SherpaOnnxVoiceActivityDetectorAcceptWaveform (const SherpaOnnxVoiceActivityDetector *p, const float *samples, int32_t n) |
| Feed audio samples to the VAD. | |
| int32_t | SherpaOnnxVoiceActivityDetectorEmpty (const SherpaOnnxVoiceActivityDetector *p) |
| Check whether the detector currently has any completed speech segment. | |
| int32_t | SherpaOnnxVoiceActivityDetectorDetected (const SherpaOnnxVoiceActivityDetector *p) |
| Check whether the detector is currently inside speech. | |
| void | SherpaOnnxVoiceActivityDetectorPop (const SherpaOnnxVoiceActivityDetector *p) |
| Remove the front speech segment from the detector queue. | |
| void | SherpaOnnxVoiceActivityDetectorClear (const SherpaOnnxVoiceActivityDetector *p) |
| Remove all queued speech segments. | |
| const SherpaOnnxSpeechSegment * | SherpaOnnxVoiceActivityDetectorFront (const SherpaOnnxVoiceActivityDetector *p) |
| Get the first queued speech segment. | |
| void | SherpaOnnxDestroySpeechSegment (const SherpaOnnxSpeechSegment *p) |
| Destroy a speech segment returned by SherpaOnnxVoiceActivityDetectorFront(). | |
| void | SherpaOnnxVoiceActivityDetectorReset (const SherpaOnnxVoiceActivityDetector *p) |
| Reset a voice activity detector so it can process a new stream. | |
| void | SherpaOnnxVoiceActivityDetectorFlush (const SherpaOnnxVoiceActivityDetector *p) |
| Flush buffered tail samples and force final segmentation. | |
| const SherpaOnnxOfflineTts * | SherpaOnnxCreateOfflineTts (const SherpaOnnxOfflineTtsConfig *config) |
| Create an offline TTS engine. | |
| void | SherpaOnnxDestroyOfflineTts (const SherpaOnnxOfflineTts *tts) |
| Destroy an offline TTS engine. | |
| int32_t | SherpaOnnxOfflineTtsSampleRate (const SherpaOnnxOfflineTts *tts) |
| Return the output sample rate of a TTS engine. | |
| int32_t | SherpaOnnxOfflineTtsNumSpeakers (const SherpaOnnxOfflineTts *tts) |
| Return the number of available speaker IDs. | |
| const char * | SherpaOnnxOfflineTtsLang (const SherpaOnnxOfflineTts *tts) |
| Return the language/voice of the model, e.g., "en-us". | |
| void | SherpaOnnxDestroyOfflineTtsLang (const char *s) |
| Free a string returned by SherpaOnnxOfflineTtsLang(). | |
| const SherpaOnnxGeneratedAudio * | SherpaOnnxOfflineTtsGenerate (const SherpaOnnxOfflineTts *tts, const char *text, int32_t sid, float speed) |
| Generate speech from text using the simple sid/speed interface. | |
| const SherpaOnnxGeneratedAudio * | SherpaOnnxOfflineTtsGenerateWithCallback (const SherpaOnnxOfflineTts *tts, const char *text, int32_t sid, float speed, SherpaOnnxGeneratedAudioCallback callback) |
| Generate speech and receive incremental audio chunks through a callback. | |
| const SherpaOnnxGeneratedAudio * | SherpaOnnxOfflineTtsGenerateWithProgressCallback (const SherpaOnnxOfflineTts *tts, const char *text, int32_t sid, float speed, SherpaOnnxGeneratedAudioProgressCallback callback) |
| Generate speech with a progress callback. | |
| const SherpaOnnxGeneratedAudio * | SherpaOnnxOfflineTtsGenerateWithProgressCallbackWithArg (const SherpaOnnxOfflineTts *tts, const char *text, int32_t sid, float speed, SherpaOnnxGeneratedAudioProgressCallbackWithArg callback, void *arg) |
| Generate speech with a progress callback that receives a user pointer. | |
| const SherpaOnnxGeneratedAudio * | SherpaOnnxOfflineTtsGenerateWithCallbackWithArg (const SherpaOnnxOfflineTts *tts, const char *text, int32_t sid, float speed, SherpaOnnxGeneratedAudioCallbackWithArg callback, void *arg) |
| Same as SherpaOnnxOfflineTtsGenerateWithCallback() but with a user pointer. | |
| const SherpaOnnxGeneratedAudio * | SherpaOnnxOfflineTtsGenerateWithZipvoice (const SherpaOnnxOfflineTts *tts, const char *text, const char *prompt_text, const float *prompt_samples, int32_t n_prompt, int32_t prompt_sr, float speed, int32_t num_steps) |
| Deprecated ZipVoice-specific generation API. | |
| const SherpaOnnxGeneratedAudio * | SherpaOnnxOfflineTtsGenerateWithConfig (const SherpaOnnxOfflineTts *tts, const char *text, const SherpaOnnxGenerationConfig *config, SherpaOnnxGeneratedAudioProgressCallbackWithArg callback, void *arg) |
| Generate speech using the advanced configuration interface. | |
| void | SherpaOnnxDestroyOfflineTtsGeneratedAudio (const SherpaOnnxGeneratedAudio *p) |
| Destroy audio returned by a TTS generation API. | |
| int32_t | SherpaOnnxWriteWave (const float *samples, int32_t n, int32_t sample_rate, const char *filename) |
| Write floating-point PCM to a mono 16-bit WAVE file. | |
| int64_t | SherpaOnnxWaveFileSize (int32_t n_samples) |
| Return the number of bytes needed for a mono 16-bit WAVE file. | |
| void | SherpaOnnxWriteWaveToBuffer (const float *samples, int32_t n, int32_t sample_rate, char *buffer) |
| Write a mono 16-bit WAVE file to a caller-provided buffer. | |
| int32_t | SherpaOnnxWriteWaveMultiChannel (const float *const *samples, int32_t n, int32_t sample_rate, int32_t num_channels, const char *filename) |
| Write multi-channel audio to a WAVE file (16-bit PCM). | |
| SherpaOnnxForcedAligner * | SherpaOnnxCreateForcedAligner (const SherpaOnnxForcedAlignerConfig *config) |
| Create a forced aligner from a model directory and a pronunciation dictionary. | |
| void | SherpaOnnxDestroyForcedAligner (const SherpaOnnxForcedAligner *aligner) |
| Free a forced aligner created by SherpaOnnxCreateForcedAligner(). | |
| SherpaOnnxOfflineStream * | SherpaOnnxForcedAlignerCreateStream (const SherpaOnnxForcedAligner *aligner) |
| Create an utterance stream for a forced aligner. | |
| const SherpaOnnxForcedAlignmentResult * | SherpaOnnxForcedAlignerCompute (const SherpaOnnxForcedAligner *aligner, const SherpaOnnxOfflineStream *stream, const char *text) |
| Compute the alignment of one utterance. | |
| void | SherpaOnnxDestroyForcedAlignmentResult (const SherpaOnnxForcedAlignmentResult *result) |
| Free the result of SherpaOnnxForcedAlignerCompute(). | |
| const SherpaOnnxWave * | SherpaOnnxReadWave (const char *filename) |
| Read a mono 16-bit PCM WAVE file. | |
| const SherpaOnnxWave * | SherpaOnnxReadWaveFromBinaryData (const char *data, int32_t n) |
| Read a mono 16-bit PCM WAVE file from binary memory. | |
| void | SherpaOnnxFreeWave (const SherpaOnnxWave *wave) |
| Destroy a wave object returned by SherpaOnnxReadWave() or SherpaOnnxReadWaveFromBinaryData(). | |
| const SherpaOnnxMultiChannelWave * | SherpaOnnxReadWaveMultiChannel (const char *filename) |
| Read a multi-channel 16-bit PCM WAVE file. | |
| void | SherpaOnnxFreeMultiChannelWave (const SherpaOnnxMultiChannelWave *wave) |
| Destroy a multi-channel wave object. | |
| const SherpaOnnxSpokenLanguageIdentification * | SherpaOnnxCreateSpokenLanguageIdentification (const SherpaOnnxSpokenLanguageIdentificationConfig *config) |
| Create a spoken-language identifier. | |
| void | SherpaOnnxDestroySpokenLanguageIdentification (const SherpaOnnxSpokenLanguageIdentification *slid) |
| Destroy a spoken-language identifier. | |
| SherpaOnnxOfflineStream * | SherpaOnnxSpokenLanguageIdentificationCreateOfflineStream (const SherpaOnnxSpokenLanguageIdentification *slid) |
| Create an offline stream for spoken-language identification. | |
| const SherpaOnnxSpokenLanguageIdentificationResult * | SherpaOnnxSpokenLanguageIdentificationCompute (const SherpaOnnxSpokenLanguageIdentification *slid, const SherpaOnnxOfflineStream *s) |
| Run spoken-language identification on an offline stream. | |
| void | SherpaOnnxDestroySpokenLanguageIdentificationResult (const SherpaOnnxSpokenLanguageIdentificationResult *r) |
| Destroy a spoken-language identification result. | |
| const SherpaOnnxSpeakerEmbeddingExtractor * | SherpaOnnxCreateSpeakerEmbeddingExtractor (const SherpaOnnxSpeakerEmbeddingExtractorConfig *config) |
| Create a speaker embedding extractor. | |
| void | SherpaOnnxDestroySpeakerEmbeddingExtractor (const SherpaOnnxSpeakerEmbeddingExtractor *p) |
| Destroy a speaker embedding extractor. | |
| int32_t | SherpaOnnxSpeakerEmbeddingExtractorDim (const SherpaOnnxSpeakerEmbeddingExtractor *p) |
| Return the embedding dimension produced by the extractor. | |
| const SherpaOnnxOnlineStream * | SherpaOnnxSpeakerEmbeddingExtractorCreateStream (const SherpaOnnxSpeakerEmbeddingExtractor *p) |
| Create a streaming feature buffer for embedding extraction. | |
| int32_t | SherpaOnnxSpeakerEmbeddingExtractorIsReady (const SherpaOnnxSpeakerEmbeddingExtractor *p, const SherpaOnnxOnlineStream *s) |
| Check whether enough audio has been provided to compute an embedding. | |
| const float * | SherpaOnnxSpeakerEmbeddingExtractorComputeEmbedding (const SherpaOnnxSpeakerEmbeddingExtractor *p, const SherpaOnnxOnlineStream *s) |
| Compute the embedding for a stream. | |
| void | SherpaOnnxSpeakerEmbeddingExtractorDestroyEmbedding (const float *v) |
| Destroy an embedding vector returned by SherpaOnnxSpeakerEmbeddingExtractorComputeEmbedding(). | |
| const SherpaOnnxSpeakerEmbeddingManager * | SherpaOnnxCreateSpeakerEmbeddingManager (int32_t dim) |
| Create a speaker embedding manager. | |
| void | SherpaOnnxDestroySpeakerEmbeddingManager (const SherpaOnnxSpeakerEmbeddingManager *p) |
| Destroy a speaker embedding manager. | |
| int32_t | SherpaOnnxSpeakerEmbeddingManagerAdd (const SherpaOnnxSpeakerEmbeddingManager *p, const char *name, const float *v) |
| Add one enrollment embedding for a speaker. | |
| int32_t | SherpaOnnxSpeakerEmbeddingManagerAddList (const SherpaOnnxSpeakerEmbeddingManager *p, const char *name, const float **v) |
| Add multiple enrollment embeddings for one speaker. | |
| int32_t | SherpaOnnxSpeakerEmbeddingManagerAddListFlattened (const SherpaOnnxSpeakerEmbeddingManager *p, const char *name, const float *v, int32_t n) |
| Add multiple enrollment embeddings packed in one flat array. | |
| int32_t | SherpaOnnxSpeakerEmbeddingManagerRemove (const SherpaOnnxSpeakerEmbeddingManager *p, const char *name) |
| Remove a speaker from the manager. | |
| const char * | SherpaOnnxSpeakerEmbeddingManagerSearch (const SherpaOnnxSpeakerEmbeddingManager *p, const float *v, float threshold) |
| Search for the best matching enrolled speaker. | |
| void | SherpaOnnxSpeakerEmbeddingManagerFreeSearch (const char *name) |
| Free a string returned by SherpaOnnxSpeakerEmbeddingManagerSearch(). | |
| const SherpaOnnxSpeakerEmbeddingManagerBestMatchesResult * | SherpaOnnxSpeakerEmbeddingManagerGetBestMatches (const SherpaOnnxSpeakerEmbeddingManager *p, const float *v, float threshold, int32_t n) |
Return up to n best matches above a similarity threshold. | |
| void | SherpaOnnxSpeakerEmbeddingManagerFreeBestMatches (const SherpaOnnxSpeakerEmbeddingManagerBestMatchesResult *r) |
| Destroy a best-matches result. | |
| int32_t | SherpaOnnxSpeakerEmbeddingManagerVerify (const SherpaOnnxSpeakerEmbeddingManager *p, const char *name, const float *v, float threshold) |
| Verify whether a query embedding matches a named speaker. | |
| int32_t | SherpaOnnxSpeakerEmbeddingManagerContains (const SherpaOnnxSpeakerEmbeddingManager *p, const char *name) |
| Check whether a speaker is enrolled. | |
| int32_t | SherpaOnnxSpeakerEmbeddingManagerNumSpeakers (const SherpaOnnxSpeakerEmbeddingManager *p) |
| Return the number of enrolled speakers. | |
| int32_t | SherpaOnnxSpeakerEmbeddingManagerDim (const SherpaOnnxSpeakerEmbeddingManager *p) |
| Return the embedding dimension. | |
| const char *const * | SherpaOnnxSpeakerEmbeddingManagerGetAllSpeakers (const SherpaOnnxSpeakerEmbeddingManager *p) |
| Return all enrolled speaker names. | |
| void | SherpaOnnxSpeakerEmbeddingManagerFreeAllSpeakers (const char *const *names) |
| Free an array returned by SherpaOnnxSpeakerEmbeddingManagerGetAllSpeakers(). | |
| const float * | SherpaOnnxSpeakerEmbeddingManagerGetEmbedding (const SherpaOnnxSpeakerEmbeddingManager *p, const char *name) |
| Return a copy of the embedding of a speaker. | |
| void | SherpaOnnxSpeakerEmbeddingManagerDestroyEmbedding (const float *v) |
| Free an embedding returned by SherpaOnnxSpeakerEmbeddingManagerGetEmbedding(). | |
| const SherpaOnnxAudioTagging * | SherpaOnnxCreateAudioTagging (const SherpaOnnxAudioTaggingConfig *config) |
| Create an audio tagger. | |
| void | SherpaOnnxDestroyAudioTagging (const SherpaOnnxAudioTagging *tagger) |
| Destroy an audio tagger. | |
| const SherpaOnnxOfflineStream * | SherpaOnnxAudioTaggingCreateOfflineStream (const SherpaOnnxAudioTagging *tagger) |
| Create an offline stream for audio tagging. | |
| const SherpaOnnxAudioEvent *const * | SherpaOnnxAudioTaggingCompute (const SherpaOnnxAudioTagging *tagger, const SherpaOnnxOfflineStream *s, int32_t top_k) |
| Run audio tagging on an offline stream. | |
| void | SherpaOnnxAudioTaggingFreeResults (const SherpaOnnxAudioEvent *const *p) |
| Destroy results returned by SherpaOnnxAudioTaggingCompute(). | |
| const SherpaOnnxOfflinePunctuation * | SherpaOnnxCreateOfflinePunctuation (const SherpaOnnxOfflinePunctuationConfig *config) |
| Create an offline punctuation processor. | |
| void | SherpaOnnxDestroyOfflinePunctuation (const SherpaOnnxOfflinePunctuation *punct) |
| Destroy an offline punctuation processor. | |
| const char * | SherpaOfflinePunctuationAddPunct (const SherpaOnnxOfflinePunctuation *punct, const char *text) |
| Add punctuation to a complete input text. | |
| void | SherpaOfflinePunctuationFreeText (const char *text) |
| Free a string returned by SherpaOfflinePunctuationAddPunct(). | |
| const SherpaOnnxOnlinePunctuation * | SherpaOnnxCreateOnlinePunctuation (const SherpaOnnxOnlinePunctuationConfig *config) |
| Create an online punctuation processor. | |
| void | SherpaOnnxDestroyOnlinePunctuation (const SherpaOnnxOnlinePunctuation *punctuation) |
| Destroy an online punctuation processor. | |
| const char * | SherpaOnnxOnlinePunctuationAddPunct (const SherpaOnnxOnlinePunctuation *punctuation, const char *text) |
| Add punctuation to one text chunk using the online punctuation model. | |
| void | SherpaOnnxOnlinePunctuationFreeText (const char *text) |
| Free a string returned by SherpaOnnxOnlinePunctuationAddPunct(). | |
| const SherpaOnnxLinearResampler * | SherpaOnnxCreateLinearResampler (int32_t samp_rate_in_hz, int32_t samp_rate_out_hz, float filter_cutoff_hz, int32_t num_zeros) |
| Create a linear resampler. | |
| void | SherpaOnnxDestroyLinearResampler (const SherpaOnnxLinearResampler *p) |
| Destroy a linear resampler. | |
| void | SherpaOnnxLinearResamplerReset (const SherpaOnnxLinearResampler *p) |
| Reset a linear resampler to its initial state. | |
| const SherpaOnnxResampleOut * | SherpaOnnxLinearResamplerResample (const SherpaOnnxLinearResampler *p, const float *input, int32_t input_dim, int32_t flush) |
| Resample one chunk of input audio. | |
| void | SherpaOnnxLinearResamplerResampleFree (const SherpaOnnxResampleOut *p) |
| Destroy a resampler output chunk. | |
| int32_t | SherpaOnnxLinearResamplerResampleGetInputSampleRate (const SherpaOnnxLinearResampler *p) |
| Return the resampler input sample rate. | |
| int32_t | SherpaOnnxLinearResamplerResampleGetOutputSampleRate (const SherpaOnnxLinearResampler *p) |
| Return the resampler output sample rate. | |
| const SherpaOnnxOfflineSpeakerDiarization * | SherpaOnnxCreateOfflineSpeakerDiarization (const SherpaOnnxOfflineSpeakerDiarizationConfig *config) |
| Create an offline speaker diarization pipeline. | |
| void | SherpaOnnxDestroyOfflineSpeakerDiarization (const SherpaOnnxOfflineSpeakerDiarization *sd) |
| Destroy an offline speaker diarizer. | |
| int32_t | SherpaOnnxOfflineSpeakerDiarizationGetSampleRate (const SherpaOnnxOfflineSpeakerDiarization *sd) |
| Return the expected input sample rate. | |
| void | SherpaOnnxOfflineSpeakerDiarizationSetConfig (const SherpaOnnxOfflineSpeakerDiarization *sd, const SherpaOnnxOfflineSpeakerDiarizationConfig *config) |
| Update clustering-related settings of an existing diarizer. | |
| int32_t | SherpaOnnxOfflineSpeakerDiarizationResultGetNumSpeakers (const SherpaOnnxOfflineSpeakerDiarizationResult *r) |
| Return the number of speakers in a diarization result. | |
| int32_t | SherpaOnnxOfflineSpeakerDiarizationResultGetNumSegments (const SherpaOnnxOfflineSpeakerDiarizationResult *r) |
| Return the number of diarization segments. | |
| const SherpaOnnxOfflineSpeakerDiarizationSegment * | SherpaOnnxOfflineSpeakerDiarizationResultSortByStartTime (const SherpaOnnxOfflineSpeakerDiarizationResult *r) |
| Return segments sorted by start time. | |
| void | SherpaOnnxOfflineSpeakerDiarizationDestroySegment (const SherpaOnnxOfflineSpeakerDiarizationSegment *s) |
| Destroy a segment array returned by SherpaOnnxOfflineSpeakerDiarizationResultSortByStartTime(). | |
| const SherpaOnnxOfflineSpeakerDiarizationResult * | SherpaOnnxOfflineSpeakerDiarizationProcess (const SherpaOnnxOfflineSpeakerDiarization *sd, const float *samples, int32_t n) |
| Run offline speaker diarization. | |
| const SherpaOnnxOfflineSpeakerDiarizationResult * | SherpaOnnxOfflineSpeakerDiarizationProcessWithCallback (const SherpaOnnxOfflineSpeakerDiarization *sd, const float *samples, int32_t n, SherpaOnnxOfflineSpeakerDiarizationProgressCallback callback, void *arg) |
| Run offline speaker diarization with a progress callback. | |
| const SherpaOnnxOfflineSpeakerDiarizationResult * | SherpaOnnxOfflineSpeakerDiarizationProcessWithCallbackNoArg (const SherpaOnnxOfflineSpeakerDiarization *sd, const float *samples, int32_t n, SherpaOnnxOfflineSpeakerDiarizationProgressCallbackNoArg callback) |
| Run offline speaker diarization with a progress callback that has no user pointer. | |
| void | SherpaOnnxOfflineSpeakerDiarizationDestroyResult (const SherpaOnnxOfflineSpeakerDiarizationResult *r) |
| Destroy a diarization result. | |
| const SherpaOnnxOfflineSpeechDenoiser * | SherpaOnnxCreateOfflineSpeechDenoiser (const SherpaOnnxOfflineSpeechDenoiserConfig *config) |
| Create an offline speech denoiser. | |
| void | SherpaOnnxDestroyOfflineSpeechDenoiser (const SherpaOnnxOfflineSpeechDenoiser *sd) |
| Destroy an offline speech denoiser. | |
| int32_t | SherpaOnnxOfflineSpeechDenoiserGetSampleRate (const SherpaOnnxOfflineSpeechDenoiser *sd) |
| Return the expected sample rate for the denoiser. | |
| int32_t | SherpaOnnxOfflineSpeechDenoiserSetVoiceSample (const SherpaOnnxOfflineSpeechDenoiser *sd, const float *samples, int32_t n, int32_t sample_rate) |
| Set a PCM voice sample for VoxLock. | |
| const SherpaOnnxDenoisedAudio * | SherpaOnnxOfflineSpeechDenoiserRun (const SherpaOnnxOfflineSpeechDenoiser *sd, const float *samples, int32_t n, int32_t sample_rate) |
| Run offline speech denoising on a complete waveform. | |
| void | SherpaOnnxDestroyDenoisedAudio (const SherpaOnnxDenoisedAudio *p) |
| Destroy denoised audio returned by a speech enhancement API. | |
| const SherpaOnnxOnlineSpeechDenoiser * | SherpaOnnxCreateOnlineSpeechDenoiser (const SherpaOnnxOnlineSpeechDenoiserConfig *config) |
| Create an online speech denoiser. | |
| void | SherpaOnnxDestroyOnlineSpeechDenoiser (const SherpaOnnxOnlineSpeechDenoiser *sd) |
| Destroy an online speech denoiser. | |
| int32_t | SherpaOnnxOnlineSpeechDenoiserGetSampleRate (const SherpaOnnxOnlineSpeechDenoiser *sd) |
| Return the expected input sample rate for the online denoiser. | |
| int32_t | SherpaOnnxOnlineSpeechDenoiserGetFrameShiftInSamples (const SherpaOnnxOnlineSpeechDenoiser *sd) |
| Return the recommended chunk size in samples for streaming input. | |
| const SherpaOnnxDenoisedAudio * | SherpaOnnxOnlineSpeechDenoiserRun (const SherpaOnnxOnlineSpeechDenoiser *sd, const float *samples, int32_t n, int32_t sample_rate) |
| Process one chunk of streaming audio. | |
| const SherpaOnnxDenoisedAudio * | SherpaOnnxOnlineSpeechDenoiserFlush (const SherpaOnnxOnlineSpeechDenoiser *sd) |
| Flush buffered samples and reset the online denoiser. | |
| void | SherpaOnnxOnlineSpeechDenoiserReset (const SherpaOnnxOnlineSpeechDenoiser *sd) |
| Reset an online denoiser so it can process a new stream. | |
| int32_t | SherpaOnnxOnlineSpeechDenoiserSetVoiceSample (const SherpaOnnxOnlineSpeechDenoiser *sd, const float *samples, int32_t n, int32_t sample_rate) |
| Set a PCM voice sample for VoxLock. | |
| const SherpaOnnxOfflineSourceSeparation * | SherpaOnnxCreateOfflineSourceSeparation (const SherpaOnnxOfflineSourceSeparationConfig *config) |
| Create a source-separation engine. | |
| void | SherpaOnnxDestroyOfflineSourceSeparation (const SherpaOnnxOfflineSourceSeparation *ss) |
| Destroy a source-separation engine. | |
| int32_t | SherpaOnnxOfflineSourceSeparationGetOutputSampleRate (const SherpaOnnxOfflineSourceSeparation *ss) |
| Return the output sample rate of the source-separation engine. | |
| int32_t | SherpaOnnxOfflineSourceSeparationGetNumberOfStems (const SherpaOnnxOfflineSourceSeparation *ss) |
| Return the number of stems produced by the engine. | |
| const SherpaOnnxSourceSeparationOutput * | SherpaOnnxOfflineSourceSeparationProcess (const SherpaOnnxOfflineSourceSeparation *ss, const float *const *samples, int32_t num_channels, int32_t num_samples, int32_t sample_rate) |
| Run source separation on multi-channel audio. | |
| void | SherpaOnnxDestroySourceSeparationOutput (const SherpaOnnxSourceSeparationOutput *p) |
| Destroy the output of a source-separation run. | |
| const SherpaOnnxOfflineDiacritization * | SherpaOnnxCreateOfflineDiacritization (const SherpaOnnxOfflineDiacritizationConfig *config) |
| Create an offline diacritization processor. | |
| void | SherpaOnnxDestroyOfflineDiacritization (const SherpaOnnxOfflineDiacritization *diacrt) |
| Destroy an offline diacritization processor. | |
| const char * | SherpaOfflineDiacritizationAddDiacritics (const SherpaOnnxOfflineDiacritization *diacrt, const char *text) |
| Add diacritics to a complete input text. | |
| void | SherpaOfflineDiacritizationFreeText (const char *text) |
| Free a string returned by SherpaOfflineDiacritizationAddDiacritics(). | |
This header exposes the main sherpa-onnx inference features through a stable C interface. It is intended for native C/C++ applications and for language bindings that need a C ABI.
The file is organized by feature family. The major API groups are:
Common ownership rules:
General usage pattern:
The examples in c-api-examples/ show complete end-to-end usage. Useful starting points include:
Definition in file c-api.h.
| #define SHERPA_ONNX_API SHERPA_ONNX_IMPORT |
Definition at line 110 of file c-api.h.
Referenced by sherpa_onnx::cxx::FileExists(), sherpa_onnx::cxx::GetGitDate(), sherpa_onnx::cxx::GetGitSha1(), sherpa_onnx::cxx::GetOnnxruntimeVersionStr(), sherpa_onnx::cxx::GetVersionStr(), sherpa_onnx::cxx::ReadWave(), SherpaOfflineDiacritizationAddDiacritics(), SherpaOfflineDiacritizationFreeText(), SherpaOfflinePunctuationAddPunct(), SherpaOfflinePunctuationFreeText(), SherpaOnnxAcceptWaveformOffline(), SherpaOnnxAudioTaggingCreateOfflineStream(), SherpaOnnxAudioTaggingFreeResults(), SherpaOnnxCircularBufferFree(), SherpaOnnxCircularBufferGet(), SherpaOnnxCircularBufferPop(), SherpaOnnxCircularBufferPush(), SherpaOnnxCircularBufferReset(), SherpaOnnxCircularBufferSize(), SherpaOnnxCreateAudioTagging(), SherpaOnnxCreateCircularBuffer(), SherpaOnnxCreateDisplay(), SherpaOnnxCreateForcedAligner(), SherpaOnnxCreateKeywordSpotter(), SherpaOnnxCreateKeywordStream(), SherpaOnnxCreateKeywordStreamWithKeywords(), SherpaOnnxCreateOfflineStream(), SherpaOnnxCreateOfflineTts(), SherpaOnnxCreateOnlineStream(), SherpaOnnxDecodeKeywordStream(), SherpaOnnxDecodeMultipleKeywordStreams(), SherpaOnnxDecodeMultipleOfflineStreams(), SherpaOnnxDecodeMultipleOnlineStreams(), SherpaOnnxDecodeOfflineStream(), SherpaOnnxDecodeOnlineStream(), SherpaOnnxDestroyAudioTagging(), SherpaOnnxDestroyCircularBuffer(), SherpaOnnxDestroyDenoisedAudio(), SherpaOnnxDestroyDisplay(), SherpaOnnxDestroyForcedAligner(), SherpaOnnxDestroyForcedAlignmentResult(), SherpaOnnxDestroyKeywordResult(), SherpaOnnxDestroyKeywordSpotter(), SherpaOnnxDestroyLinearResampler(), SherpaOnnxDestroyOfflineDiacritization(), SherpaOnnxDestroyOfflinePunctuation(), SherpaOnnxDestroyOfflineRecognizer(), SherpaOnnxDestroyOfflineRecognizerResult(), SherpaOnnxDestroyOfflineSourceSeparation(), SherpaOnnxDestroyOfflineSpeakerDiarization(), SherpaOnnxDestroyOfflineSpeechDenoiser(), SherpaOnnxDestroyOfflineStream(), SherpaOnnxDestroyOfflineStreamResultJson(), SherpaOnnxDestroyOfflineTts(), SherpaOnnxDestroyOfflineTtsGeneratedAudio(), SherpaOnnxDestroyOfflineTtsLang(), SherpaOnnxDestroyOnlinePunctuation(), SherpaOnnxDestroyOnlineRecognizer(), SherpaOnnxDestroyOnlineRecognizerResult(), SherpaOnnxDestroyOnlineSpeechDenoiser(), SherpaOnnxDestroyOnlineStream(), SherpaOnnxDestroyOnlineStreamResultJson(), SherpaOnnxDestroySourceSeparationOutput(), SherpaOnnxDestroySpeakerEmbeddingExtractor(), SherpaOnnxDestroySpeakerEmbeddingManager(), SherpaOnnxDestroySpeechSegment(), SherpaOnnxDestroySpokenLanguageIdentification(), SherpaOnnxDestroySpokenLanguageIdentificationResult(), SherpaOnnxDestroyVoiceActivityDetector(), SherpaOnnxFileExists(), SherpaOnnxForcedAlignerCreateStream(), SherpaOnnxFreeKeywordResultJson(), SherpaOnnxFreeMultiChannelWave(), SherpaOnnxFreeWave(), SherpaOnnxGetGitDate(), SherpaOnnxGetGitSha1(), SherpaOnnxGetKeywordResult(), SherpaOnnxGetKeywordResultAsJson(), SherpaOnnxGetOfflineStreamResultAsJson(), SherpaOnnxGetOnlineStreamResultAsJson(), SherpaOnnxGetOnnxruntimeVersionStr(), SherpaOnnxGetVersionStr(), SherpaOnnxLinearResamplerResample(), SherpaOnnxLinearResamplerResampleFree(), SherpaOnnxLinearResamplerResampleGetInputSampleRate(), SherpaOnnxLinearResamplerResampleGetOutputSampleRate(), SherpaOnnxLinearResamplerReset(), SherpaOnnxOfflineRecognizerSetConfig(), SherpaOnnxOfflineSourceSeparationGetNumberOfStems(), SherpaOnnxOfflineSourceSeparationGetOutputSampleRate(), SherpaOnnxOfflineSpeakerDiarizationDestroyResult(), SherpaOnnxOfflineSpeakerDiarizationDestroySegment(), SherpaOnnxOfflineSpeakerDiarizationGetSampleRate(), SherpaOnnxOfflineSpeakerDiarizationProcess(), SherpaOnnxOfflineSpeakerDiarizationProcessWithCallback(), SherpaOnnxOfflineSpeakerDiarizationResultGetNumSegments(), SherpaOnnxOfflineSpeakerDiarizationResultGetNumSpeakers(), SherpaOnnxOfflineSpeakerDiarizationSetConfig(), SherpaOnnxOfflineSpeechDenoiserGetSampleRate(), SherpaOnnxOfflineSpeechDenoiserSetVoiceSample(), SherpaOnnxOfflineStreamGetOption(), SherpaOnnxOfflineStreamHasOption(), SherpaOnnxOfflineStreamSetOption(), SherpaOnnxOfflineTtsGenerate(), SherpaOnnxOfflineTtsGenerateWithCallback(), SherpaOnnxOfflineTtsGenerateWithCallbackWithArg(), SherpaOnnxOfflineTtsGenerateWithProgressCallback(), SherpaOnnxOfflineTtsGenerateWithProgressCallbackWithArg(), SherpaOnnxOfflineTtsNumSpeakers(), SherpaOnnxOfflineTtsSampleRate(), SherpaOnnxOnlinePunctuationAddPunct(), SherpaOnnxOnlinePunctuationFreeText(), SherpaOnnxOnlineSpeechDenoiserGetFrameShiftInSamples(), SherpaOnnxOnlineSpeechDenoiserGetSampleRate(), SherpaOnnxOnlineSpeechDenoiserReset(), SherpaOnnxOnlineSpeechDenoiserRun(), SherpaOnnxOnlineSpeechDenoiserSetVoiceSample(), SherpaOnnxOnlineStreamAcceptWaveform(), SherpaOnnxOnlineStreamGetOption(), SherpaOnnxOnlineStreamHasOption(), SherpaOnnxOnlineStreamInputFinished(), SherpaOnnxOnlineStreamReset(), SherpaOnnxOnlineStreamSetOption(), SherpaOnnxPrint(), SherpaOnnxReadWave(), SherpaOnnxReadWaveFromBinaryData(), SherpaOnnxResetKeywordStream(), SherpaOnnxSpeakerEmbeddingExtractorDestroyEmbedding(), SherpaOnnxSpeakerEmbeddingExtractorDim(), SherpaOnnxSpeakerEmbeddingExtractorIsReady(), SherpaOnnxSpeakerEmbeddingManagerAddList(), SherpaOnnxSpeakerEmbeddingManagerAddListFlattened(), SherpaOnnxSpeakerEmbeddingManagerContains(), SherpaOnnxSpeakerEmbeddingManagerDestroyEmbedding(), SherpaOnnxSpeakerEmbeddingManagerDim(), SherpaOnnxSpeakerEmbeddingManagerFreeAllSpeakers(), SherpaOnnxSpeakerEmbeddingManagerFreeBestMatches(), SherpaOnnxSpeakerEmbeddingManagerFreeSearch(), SherpaOnnxSpeakerEmbeddingManagerGetEmbedding(), SherpaOnnxSpeakerEmbeddingManagerNumSpeakers(), SherpaOnnxSpeakerEmbeddingManagerRemove(), SherpaOnnxSpeakerEmbeddingManagerSearch(), SherpaOnnxSpeakerEmbeddingManagerVerify(), SherpaOnnxVoiceActivityDetectorAcceptWaveform(), SherpaOnnxVoiceActivityDetectorClear(), SherpaOnnxVoiceActivityDetectorDetected(), SherpaOnnxVoiceActivityDetectorFlush(), SherpaOnnxVoiceActivityDetectorPop(), SherpaOnnxVoiceActivityDetectorReset(), SherpaOnnxWaveFileSize(), SherpaOnnxWriteWave(), SherpaOnnxWriteWaveMultiChannel(), SherpaOnnxWriteWaveToBuffer(), and sherpa_onnx::cxx::WriteWave().
| #define SHERPA_ONNX_EXPORT __attribute__((visibility("default"))) |
| #define SHERPA_ONNX_IMPORT SHERPA_ONNX_EXPORT |
| typedef struct SherpaOnnxAudioEvent SherpaOnnxAudioEvent |
| typedef struct SherpaOnnxAudioTagging SherpaOnnxAudioTagging |
| typedef struct SherpaOnnxAudioTaggingConfig SherpaOnnxAudioTaggingConfig |
| typedef struct SherpaOnnxAudioTaggingModelConfig SherpaOnnxAudioTaggingModelConfig |
Configure exactly one model family. If multiple model families are provided, one of them will be used and the choice is implementation-defined.
Example using sherpa-onnx-zipformer-audio-tagging-2024-04-09:
| typedef struct SherpaOnnxCircularBuffer SherpaOnnxCircularBuffer |
| typedef struct SherpaOnnxDenoisedAudio SherpaOnnxDenoisedAudio |
Free this object with SherpaOnnxDestroyDenoisedAudio().
| typedef struct SherpaOnnxDisplay SherpaOnnxDisplay |
| typedef struct SherpaOnnxFastClusteringConfig SherpaOnnxFastClusteringConfig |
If num_clusters is greater than 0, threshold is ignored. When the number of speakers is known in advance, setting num_clusters is strongly recommended.
| typedef struct SherpaOnnxFeatureConfig SherpaOnnxFeatureConfig |
The bundled ASR models typically expect 16 kHz mono audio and 80-bin features.
| typedef struct SherpaOnnxForcedAligner SherpaOnnxForcedAligner |
Create it with SherpaOnnxCreateForcedAligner() and destroy it with SherpaOnnxDestroyForcedAligner().
| typedef struct SherpaOnnxForcedAlignerConfig SherpaOnnxForcedAlignerConfig |
| typedef struct SherpaOnnxForcedAlignmentInterval SherpaOnnxForcedAlignmentInterval |
One aligned interval: a phone in the "phones" tier or a word in the "words" tier.
| typedef struct SherpaOnnxForcedAlignmentOptions SherpaOnnxForcedAlignmentOptions |
| typedef struct SherpaOnnxForcedAlignmentResult SherpaOnnxForcedAlignmentResult |
tiers[0].name == "phones", tiers[1].name == "words".
| typedef struct SherpaOnnxForcedAlignmentTier SherpaOnnxForcedAlignmentTier |
One tier of the alignment (phones or words).
| typedef struct SherpaOnnxGeneratedAudio SherpaOnnxGeneratedAudio |
The returned structure owns samples. Free the whole object with SherpaOnnxDestroyOfflineTtsGeneratedAudio().
| typedef int32_t(* SherpaOnnxGeneratedAudioCallback) (const float *samples, int32_t n) |
| typedef int32_t(* SherpaOnnxGeneratedAudioCallbackWithArg) (const float *samples, int32_t n, void *arg) |
| typedef int32_t(* SherpaOnnxGeneratedAudioProgressCallback) (const float *samples, int32_t n, float p) |
| typedef int32_t(* SherpaOnnxGeneratedAudioProgressCallbackWithArg) (const float *samples, int32_t n, float p, void *arg) |
| typedef struct SherpaOnnxGenerationConfig SherpaOnnxGenerationConfig |
This struct supports both simple multi-speaker synthesis and more advanced zero-shot or reference-conditioned models.
Example for Pocket TTS:
| typedef struct SherpaOnnxHomophoneReplacerConfig SherpaOnnxHomophoneReplacerConfig |
| typedef struct SherpaOnnxKeywordResult SherpaOnnxKeywordResult |
Free this object with SherpaOnnxDestroyKeywordResult().
| typedef struct SherpaOnnxKeywordSpotter SherpaOnnxKeywordSpotter |
| typedef struct SherpaOnnxKeywordSpotterConfig SherpaOnnxKeywordSpotterConfig |
The acoustic model is configured through model_config. In practice this is usually a streaming transducer model.
Keyword definitions can be provided either through keywords_file or through keywords_buf/ If both are set, the buffer is used.keywords_buf_size.
Example using sherpa-onnx-kws-zipformer-wenetspeech-3.3M-2024-01-01-mobile:
| typedef struct SherpaOnnxLinearResampler SherpaOnnxLinearResampler |
| typedef struct SherpaOnnxMultiChannelWave SherpaOnnxMultiChannelWave |
Free this object with SherpaOnnxFreeMultiChannelWave().
| typedef struct SherpaOnnxOfflineCanaryModelConfig SherpaOnnxOfflineCanaryModelConfig |
| typedef struct SherpaOnnxOfflineCohereTranscribeModelConfig SherpaOnnxOfflineCohereTranscribeModelConfig |
| typedef struct SherpaOnnxOfflineCtcFstDecoderConfig SherpaOnnxOfflineCtcFstDecoderConfig |
| typedef struct SherpaOnnxOfflineDiacritization SherpaOnnxOfflineDiacritization |
| typedef struct SherpaOnnxOfflineDiacritizationConfig SherpaOnnxOfflineDiacritizationConfig |
| typedef struct SherpaOnnxOfflineDiacritizationModelConfig SherpaOnnxOfflineDiacritizationModelConfig |
| typedef struct SherpaOnnxOfflineDolphinModelConfig SherpaOnnxOfflineDolphinModelConfig |
| typedef struct SherpaOnnxOfflineFireRedAsrCtcModelConfig SherpaOnnxOfflineFireRedAsrCtcModelConfig |
| typedef struct SherpaOnnxOfflineFireRedAsrModelConfig SherpaOnnxOfflineFireRedAsrModelConfig |
| typedef struct SherpaOnnxOfflineFunASRNanoModelConfig SherpaOnnxOfflineFunASRNanoModelConfig |
| typedef struct SherpaOnnxOfflineLMConfig SherpaOnnxOfflineLMConfig |
| typedef struct SherpaOnnxOfflineMedAsrCtcModelConfig SherpaOnnxOfflineMedAsrCtcModelConfig |
| typedef struct SherpaOnnxOfflineModelConfig SherpaOnnxOfflineModelConfig |
Zero-initialize this struct before use, then fill in exactly the sub-config needed by the model family you want to run.
Exactly one model family should be configured for each recognizer. For example, set only one of transducer, paraformer, nemo_ctc, whisper, tdnn, sense_voice, moonshine, fire_red_asr, dolphin, zipformer_ctc, canary, cohere_transcribe, wenet_ctc, omnilingual, medasr, funasr_nano, fire_red_asr_ctc, or qwen3_asr.
If multiple model families are configured at the same time, the implementation will choose one of them, and which one is used is implementation-defined. Do not rely on any precedence rule.
| typedef struct SherpaOnnxOfflineMoonshineModelConfig SherpaOnnxOfflineMoonshineModelConfig |
| typedef struct SherpaOnnxOfflineNemoEncDecCtcModelConfig SherpaOnnxOfflineNemoEncDecCtcModelConfig |
| typedef struct SherpaOnnxOfflineOmnilingualAsrCtcModelConfig SherpaOnnxOfflineOmnilingualAsrCtcModelConfig |
| typedef struct SherpaOnnxOfflineParaformerModelConfig SherpaOnnxOfflineParaformerModelConfig |
| typedef struct SherpaOnnxOfflinePunctuation SherpaOnnxOfflinePunctuation |
| typedef struct SherpaOnnxOfflinePunctuationConfig SherpaOnnxOfflinePunctuationConfig |
| typedef struct SherpaOnnxOfflinePunctuationModelConfig SherpaOnnxOfflinePunctuationModelConfig |
Example:
| typedef struct SherpaOnnxOfflineQwen3ASRModelConfig SherpaOnnxOfflineQwen3ASRModelConfig |
| typedef struct SherpaOnnxOfflineRecognizer SherpaOnnxOfflineRecognizer |
| typedef struct SherpaOnnxOfflineRecognizerConfig SherpaOnnxOfflineRecognizerConfig |
Zero-initialize this struct before use.
Example using Whisper:
Example using SenseVoice:
Example using Parakeet TDT:
| typedef struct SherpaOnnxOfflineRecognizerResult SherpaOnnxOfflineRecognizerResult |
All pointers in this struct are owned by the result object returned from SherpaOnnxGetOfflineStreamResult() and become invalid after SherpaOnnxDestroyOfflineRecognizerResult() is called.
| typedef struct SherpaOnnxOfflineSenseVoiceModelConfig SherpaOnnxOfflineSenseVoiceModelConfig |
| typedef struct SherpaOnnxOfflineSourceSeparationConfig SherpaOnnxOfflineSourceSeparationConfig |
| typedef struct SherpaOnnxOfflineSourceSeparationModelConfig SherpaOnnxOfflineSourceSeparationModelConfig |
| typedef struct SherpaOnnxOfflineSourceSeparationSpleeterModelConfig SherpaOnnxOfflineSourceSeparationSpleeterModelConfig |
| typedef struct SherpaOnnxOfflineSourceSeparationUvrModelConfig SherpaOnnxOfflineSourceSeparationUvrModelConfig |
| typedef struct SherpaOnnxOfflineSpeakerDiarizationConfig SherpaOnnxOfflineSpeakerDiarizationConfig |
Example based on offline-speaker-diarization-c-api.c:
| typedef int32_t(* SherpaOnnxOfflineSpeakerDiarizationProgressCallback) (int32_t num_processed_chunks, int32_t num_total_chunks, void *arg) |
| typedef int32_t(* SherpaOnnxOfflineSpeakerDiarizationProgressCallbackNoArg) (int32_t num_processed_chunks, int32_t num_total_chunks) |
| typedef struct SherpaOnnxOfflineSpeakerDiarizationSegment SherpaOnnxOfflineSpeakerDiarizationSegment |
| typedef struct SherpaOnnxOfflineSpeakerSegmentationModelConfig SherpaOnnxOfflineSpeakerSegmentationModelConfig |
Configure exactly one model family. If multiple model families are provided, one is chosen and the choice is implementation-defined.
| typedef struct SherpaOnnxOfflineSpeakerSegmentationPyannoteModelConfig SherpaOnnxOfflineSpeakerSegmentationPyannoteModelConfig |
| typedef struct SherpaOnnxOfflineSpeechDenoiser SherpaOnnxOfflineSpeechDenoiser |
| typedef struct SherpaOnnxOfflineSpeechDenoiserConfig SherpaOnnxOfflineSpeechDenoiserConfig |
| typedef struct SherpaOnnxOfflineSpeechDenoiserDpdfNetModelConfig SherpaOnnxOfflineSpeechDenoiserDpdfNetModelConfig |
| typedef struct SherpaOnnxOfflineSpeechDenoiserGtcrnModelConfig SherpaOnnxOfflineSpeechDenoiserGtcrnModelConfig |
| typedef struct SherpaOnnxOfflineSpeechDenoiserModelConfig SherpaOnnxOfflineSpeechDenoiserModelConfig |
Configure exactly one model family. If multiple model families are provided, one is chosen and the choice is implementation-defined.
| typedef struct SherpaOnnxOfflineSpeechDenoiserVoxLockModelConfig SherpaOnnxOfflineSpeechDenoiserVoxLockModelConfig |
VoxLock keeps the voice of one speaker (the caller) and removes other voices. The model is from https://github.com/arbazsiddiqui/voxlock
| typedef struct SherpaOnnxOfflineStream SherpaOnnxOfflineStream |
| typedef struct SherpaOnnxOfflineTdnnModelConfig SherpaOnnxOfflineTdnnModelConfig |
| typedef struct SherpaOnnxOfflineTransducerModelConfig SherpaOnnxOfflineTransducerModelConfig |
| typedef struct SherpaOnnxOfflineTts SherpaOnnxOfflineTts |
| typedef struct SherpaOnnxOfflineTtsConfig SherpaOnnxOfflineTtsConfig |
| typedef struct SherpaOnnxOfflineTtsKittenModelConfig SherpaOnnxOfflineTtsKittenModelConfig |
| typedef struct SherpaOnnxOfflineTtsKokoroModelConfig SherpaOnnxOfflineTtsKokoroModelConfig |
| typedef struct SherpaOnnxOfflineTtsMatchaModelConfig SherpaOnnxOfflineTtsMatchaModelConfig |
| typedef struct SherpaOnnxOfflineTtsModelConfig SherpaOnnxOfflineTtsModelConfig |
Exactly one TTS model family should be configured. For example, set only one of vits, matcha, kokoro, kitten, zipvoice, pocket, or supertonic.
If multiple model families are configured at the same time, the implementation will choose one of them, and which one is used is implementation-defined. Do not rely on any precedence rule.
Concrete example model packages in this repository include:
| typedef struct SherpaOnnxOfflineTtsPocketModelConfig SherpaOnnxOfflineTtsPocketModelConfig |
| typedef struct SherpaOnnxOfflineTtsSupertonicModelConfig SherpaOnnxOfflineTtsSupertonicModelConfig |
| typedef struct SherpaOnnxOfflineTtsVitsModelConfig SherpaOnnxOfflineTtsVitsModelConfig |
| typedef struct SherpaOnnxOfflineTtsZipvoiceModelConfig SherpaOnnxOfflineTtsZipvoiceModelConfig |
| typedef struct SherpaOnnxOfflineWenetCtcModelConfig SherpaOnnxOfflineWenetCtcModelConfig |
| typedef struct SherpaOnnxOfflineWhisperModelConfig SherpaOnnxOfflineWhisperModelConfig |
| typedef struct SherpaOnnxOfflineZipformerAudioTaggingModelConfig SherpaOnnxOfflineZipformerAudioTaggingModelConfig |
| typedef struct SherpaOnnxOfflineZipformerCtcModelConfig SherpaOnnxOfflineZipformerCtcModelConfig |
| typedef struct SherpaOnnxOnlineCtcFstDecoderConfig SherpaOnnxOnlineCtcFstDecoderConfig |
| typedef struct SherpaOnnxOnlineModelConfig SherpaOnnxOnlineModelConfig |
Zero-initialize this struct before use, then fill in the sub-config for the model family you want to use together with the shared fields such as tokens, provider, and num_threads.
Exactly one model family should be configured for each recognizer. For example, set only one of transducer, paraformer, zipformer2_ctc, nemo_ctc, or t_one_ctc.
If multiple model families are configured at the same time, the implementation will choose one of them, and which one is used is implementation-defined. Do not rely on any precedence rule.
| typedef struct SherpaOnnxOnlineNemoCtcModelConfig SherpaOnnxOnlineNemoCtcModelConfig |
| typedef struct SherpaOnnxOnlineParaformerModelConfig SherpaOnnxOnlineParaformerModelConfig |
Please visit https://k2-fsa.github.io/sherpa/onnx/pretrained_models/online-paraformer/index.html to download compatible models.
| typedef struct SherpaOnnxOnlinePunctuation SherpaOnnxOnlinePunctuation |
| typedef struct SherpaOnnxOnlinePunctuationConfig SherpaOnnxOnlinePunctuationConfig |
| typedef struct SherpaOnnxOnlinePunctuationModelConfig SherpaOnnxOnlinePunctuationModelConfig |
Example using sherpa-onnx-online-punct-en-2024-08-06:
| typedef struct SherpaOnnxOnlineRecognizer SherpaOnnxOnlineRecognizer |
| typedef struct SherpaOnnxOnlineRecognizerConfig SherpaOnnxOnlineRecognizerConfig |
Zero-initialize this struct before use. Then fill in feat_config, model_config, and any optional decoding, endpoint, or hotword settings.
Example model package: sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20
| typedef struct SherpaOnnxOnlineRecognizerResult SherpaOnnxOnlineRecognizerResult |
All pointers in this struct are owned by the result object returned from SherpaOnnxGetOnlineStreamResult() and become invalid after SherpaOnnxDestroyOnlineRecognizerResult() is called.
| typedef struct SherpaOnnxOnlineSpeechDenoiser SherpaOnnxOnlineSpeechDenoiser |
| typedef struct SherpaOnnxOnlineSpeechDenoiserConfig SherpaOnnxOnlineSpeechDenoiserConfig |
| typedef struct SherpaOnnxOnlineStream SherpaOnnxOnlineStream |
| typedef struct SherpaOnnxOnlineToneCtcModelConfig SherpaOnnxOnlineToneCtcModelConfig |
| typedef struct SherpaOnnxOnlineTransducerModelConfig SherpaOnnxOnlineTransducerModelConfig |
Please refer to https://k2-fsa.github.io/sherpa/onnx/pretrained_models/index.html to download compatible pre-trained models.
| typedef struct SherpaOnnxOnlineZipformer2CtcModelConfig SherpaOnnxOnlineZipformer2CtcModelConfig |
| typedef struct SherpaOnnxResampleOut SherpaOnnxResampleOut |
Free this object with SherpaOnnxLinearResamplerResampleFree().
| typedef struct SherpaOnnxSileroVadModelConfig SherpaOnnxSileroVadModelConfig |
| typedef struct SherpaOnnxSourceSeparationOutput SherpaOnnxSourceSeparationOutput |
| typedef struct SherpaOnnxSourceSeparationStem SherpaOnnxSourceSeparationStem |
| typedef struct SherpaOnnxSpeakerEmbeddingExtractorConfig SherpaOnnxSpeakerEmbeddingExtractorConfig |
Example using 3dspeaker_speech_campplus_sv_zh-cn_16k-common.onnx:
| typedef struct SherpaOnnxSpeakerEmbeddingManagerBestMatchesResult SherpaOnnxSpeakerEmbeddingManagerBestMatchesResult |
Free this object with SherpaOnnxSpeakerEmbeddingManagerFreeBestMatches().
| typedef struct SherpaOnnxSpeakerEmbeddingManagerSpeakerMatch SherpaOnnxSpeakerEmbeddingManagerSpeakerMatch |
| typedef struct SherpaOnnxSpeechSegment SherpaOnnxSpeechSegment |
The segment owns samples. Free the whole object with SherpaOnnxDestroySpeechSegment().
| typedef struct SherpaOnnxSpokenLanguageIdentificationConfig SherpaOnnxSpokenLanguageIdentificationConfig |
The current implementation uses Whisper-based models.
Example using sherpa-onnx-whisper-tiny:
| typedef struct SherpaOnnxSpokenLanguageIdentificationResult SherpaOnnxSpokenLanguageIdentificationResult |
Free this object with SherpaOnnxDestroySpokenLanguageIdentificationResult().
| typedef struct SherpaOnnxSpokenLanguageIdentificationWhisperConfig SherpaOnnxSpokenLanguageIdentificationWhisperConfig |
Example:
| typedef struct SherpaOnnxTenVadModelConfig SherpaOnnxTenVadModelConfig |
| typedef struct SherpaOnnxVadModelConfig SherpaOnnxVadModelConfig |
Exactly one VAD model family should be configured. Set either silero_vad.model or ten_vad.model.
If both are configured, the implementation will choose one of them, and which one is used is implementation-defined. Do not rely on any precedence rule.
Example model files:
| typedef struct SherpaOnnxVoiceActivityDetector SherpaOnnxVoiceActivityDetector |
| typedef struct SherpaOnnxWave SherpaOnnxWave |
Free this object with SherpaOnnxFreeWave().
| const char * SherpaOfflineDiacritizationAddDiacritics | ( | const SherpaOnnxOfflineDiacritization * | diacrt, |
| const char * | text ) |
| diacrt | A pointer returned by SherpaOnnxCreateOfflineDiacritization(). |
| text | Input text without diacritics. |
References SHERPA_ONNX_API.
| void SherpaOfflineDiacritizationFreeText | ( | const char * | text | ) |
| text | A pointer returned by SherpaOfflineDiacritizationAddDiacritics(). |
References SHERPA_ONNX_API.
| const char * SherpaOfflinePunctuationAddPunct | ( | const SherpaOnnxOfflinePunctuation * | punct, |
| const char * | text ) |
| punct | A pointer returned by SherpaOnnxCreateOfflinePunctuation(). |
| text | Input text without punctuation. |
References SHERPA_ONNX_API.
| void SherpaOfflinePunctuationFreeText | ( | const char * | text | ) |
| text | A pointer returned by SherpaOfflinePunctuationAddPunct(). |
References SHERPA_ONNX_API.
| void SherpaOnnxAcceptWaveformOffline | ( | const SherpaOnnxOfflineStream * | stream, |
| int32_t | sample_rate, | ||
| const float * | samples, | ||
| int32_t | n ) |
The input is mono floating-point PCM normalized to the range [-1, 1]. If sample_rate differs from the recognizer feature sample rate, sherpa-onnx resamples internally.
| stream | A pointer returned by SherpaOnnxCreateOfflineStream(). |
| sample_rate | Sample rate of samples. |
| samples | Pointer to n samples in the range [-1, 1]. |
| n | Number of samples. |
References SHERPA_ONNX_API.
| const SherpaOnnxAudioEvent *const * SherpaOnnxAudioTaggingCompute | ( | const SherpaOnnxAudioTagging * | tagger, |
| const SherpaOnnxOfflineStream * | s, | ||
| int32_t | top_k ) |
The returned array is NULL-terminated. If top_k is -1, the value stored in config.top_k is used instead.
| tagger | A pointer returned by SherpaOnnxCreateAudioTagging(). |
| s | A pointer returned by SherpaOnnxAudioTaggingCreateOfflineStream(). |
| top_k | Number of top results to return, or -1 to use the configured default. |
| const SherpaOnnxOfflineStream * SherpaOnnxAudioTaggingCreateOfflineStream | ( | const SherpaOnnxAudioTagging * | tagger | ) |
| tagger | A pointer returned by SherpaOnnxCreateAudioTagging(). |
References SHERPA_ONNX_API.
| void SherpaOnnxAudioTaggingFreeResults | ( | const SherpaOnnxAudioEvent *const * | p | ) |
| p | A pointer returned by SherpaOnnxAudioTaggingCompute(). |
References SHERPA_ONNX_API.
| void SherpaOnnxCircularBufferFree | ( | const float * | p | ) |
References SHERPA_ONNX_API.
| const float * SherpaOnnxCircularBufferGet | ( | const SherpaOnnxCircularBuffer * | buffer, |
| int64_t | start_index, | ||
| int32_t | n ) |
| buffer | A pointer returned by SherpaOnnxCreateCircularBuffer(). |
| start_index | Absolute start index in the buffer timeline. |
| n | Number of samples to copy. |
n samples. Free it with SherpaOnnxCircularBufferFree().References SHERPA_ONNX_API.
| int64_t SherpaOnnxCircularBufferHead | ( | const SherpaOnnxCircularBuffer * | buffer | ) |
The value is monotonically non-decreasing until SherpaOnnxCircularBufferReset() is called.
| buffer | A pointer returned by SherpaOnnxCreateCircularBuffer(). |
| void SherpaOnnxCircularBufferPop | ( | const SherpaOnnxCircularBuffer * | buffer, |
| int32_t | n ) |
| buffer | A pointer returned by SherpaOnnxCreateCircularBuffer(). |
| n | Number of samples to remove. |
References SHERPA_ONNX_API.
| void SherpaOnnxCircularBufferPush | ( | const SherpaOnnxCircularBuffer * | buffer, |
| const float * | p, | ||
| int32_t | n ) |
| buffer | A pointer returned by SherpaOnnxCreateCircularBuffer(). |
| p | Pointer to n samples. |
| n | Number of samples. |
References SHERPA_ONNX_API.
| void SherpaOnnxCircularBufferReset | ( | const SherpaOnnxCircularBuffer * | buffer | ) |
| buffer | A pointer returned by SherpaOnnxCreateCircularBuffer(). |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxCircularBufferSize | ( | const SherpaOnnxCircularBuffer * | buffer | ) |
| buffer | A pointer returned by SherpaOnnxCreateCircularBuffer(). |
References SHERPA_ONNX_API.
| const SherpaOnnxAudioTagging * SherpaOnnxCreateAudioTagging | ( | const SherpaOnnxAudioTaggingConfig * | config | ) |
| config | Audio-tagging configuration. |
References SHERPA_ONNX_API.
| const SherpaOnnxCircularBuffer * SherpaOnnxCreateCircularBuffer | ( | int32_t | capacity | ) |
| capacity | Maximum number of samples the buffer can keep. |
References SHERPA_ONNX_API.
| const SherpaOnnxDisplay * SherpaOnnxCreateDisplay | ( | int32_t | max_word_per_line | ) |
| max_word_per_line | Maximum number of words to show per line. |
References SHERPA_ONNX_API.
| SherpaOnnxForcedAligner * SherpaOnnxCreateForcedAligner | ( | const SherpaOnnxForcedAlignerConfig * | config | ) |
| config | Configuration for forced alignment. The caller is responsible for freeing config->model_dir, config->lexicon and config itself; they are copied internally. |
References SHERPA_ONNX_API.
| const SherpaOnnxKeywordSpotter * SherpaOnnxCreateKeywordSpotter | ( | const SherpaOnnxKeywordSpotterConfig * | config | ) |
| config | Keyword spotter configuration. |
References SHERPA_ONNX_API.
| const SherpaOnnxOnlineStream * SherpaOnnxCreateKeywordStream | ( | const SherpaOnnxKeywordSpotter * | spotter | ) |
| spotter | A pointer returned by SherpaOnnxCreateKeywordSpotter(). |
References SHERPA_ONNX_API.
| const SherpaOnnxOnlineStream * SherpaOnnxCreateKeywordStreamWithKeywords | ( | const SherpaOnnxKeywordSpotter * | spotter, |
| const char * | keywords ) |
The keywords string uses the same textual format as the keyword files used by the examples. For instance:
| spotter | A pointer returned by SherpaOnnxCreateKeywordSpotter(). |
| keywords | Inline keyword definition string. |
References SHERPA_ONNX_API.
| const SherpaOnnxLinearResampler * SherpaOnnxCreateLinearResampler | ( | int32_t | samp_rate_in_hz, |
| int32_t | samp_rate_out_hz, | ||
| float | filter_cutoff_hz, | ||
| int32_t | num_zeros ) |
If filter_cutoff_hz or num_zeros is 0, the following defaults are used (same convention as alsa-play.cc):
| samp_rate_in_hz | Input sample rate in Hz. Must be > 0. |
| samp_rate_out_hz | Output sample rate in Hz. Must be > 0. |
| filter_cutoff_hz | Low-pass cutoff frequency in Hz. Pass 0 to use the default formula above. Must be >= 0. |
| num_zeros | Low-pass filter width control parameter. Pass 0 to use the default value of 6. Must be >= 0. |
| const SherpaOnnxOfflineDiacritization * SherpaOnnxCreateOfflineDiacritization | ( | const SherpaOnnxOfflineDiacritizationConfig * | config | ) |
| config | Offline diacritization configuration. |
| const SherpaOnnxOfflinePunctuation * SherpaOnnxCreateOfflinePunctuation | ( | const SherpaOnnxOfflinePunctuationConfig * | config | ) |
| config | Offline punctuation configuration. |
| const SherpaOnnxOfflineRecognizer * SherpaOnnxCreateOfflineRecognizer | ( | const SherpaOnnxOfflineRecognizerConfig * | config | ) |
| config | Recognizer configuration. |
Whisper example:
SenseVoice example:
Parakeet TDT example:
| const SherpaOnnxOfflineSourceSeparation * SherpaOnnxCreateOfflineSourceSeparation | ( | const SherpaOnnxOfflineSourceSeparationConfig * | config | ) |
| config | Source-separation configuration. |
| const SherpaOnnxOfflineSpeakerDiarization * SherpaOnnxCreateOfflineSpeakerDiarization | ( | const SherpaOnnxOfflineSpeakerDiarizationConfig * | config | ) |
| config | Offline speaker diarization configuration. |
| const SherpaOnnxOfflineSpeechDenoiser * SherpaOnnxCreateOfflineSpeechDenoiser | ( | const SherpaOnnxOfflineSpeechDenoiserConfig * | config | ) |
Example using gtcrn_simple.onnx:
| config | Offline denoiser configuration. |
| const SherpaOnnxOfflineStream * SherpaOnnxCreateOfflineStream | ( | const SherpaOnnxOfflineRecognizer * | recognizer | ) |
| recognizer | A pointer returned by SherpaOnnxCreateOfflineRecognizer(). |
References SHERPA_ONNX_API.
| const SherpaOnnxOfflineStream * SherpaOnnxCreateOfflineStreamWithHotwords | ( | const SherpaOnnxOfflineRecognizer * | recognizer, |
| const char * | hotwords ) |
| recognizer | A pointer returned by SherpaOnnxCreateOfflineRecognizer(). |
| hotwords | Hotwords text to associate with the stream. |
| const SherpaOnnxOfflineTts * SherpaOnnxCreateOfflineTts | ( | const SherpaOnnxOfflineTtsConfig * | config | ) |
| config | TTS configuration. |
References SHERPA_ONNX_API.
| const SherpaOnnxOnlinePunctuation * SherpaOnnxCreateOnlinePunctuation | ( | const SherpaOnnxOnlinePunctuationConfig * | config | ) |
| config | Online punctuation configuration. |
| const SherpaOnnxOnlineRecognizer * SherpaOnnxCreateOnlineRecognizer | ( | const SherpaOnnxOnlineRecognizerConfig * | config | ) |
The returned recognizer runs locally and does not require Internet access.
| config | Recognizer configuration. |
| const SherpaOnnxOnlineSpeechDenoiser * SherpaOnnxCreateOnlineSpeechDenoiser | ( | const SherpaOnnxOnlineSpeechDenoiserConfig * | config | ) |
| config | Online denoiser configuration. |
| const SherpaOnnxOnlineStream * SherpaOnnxCreateOnlineStream | ( | const SherpaOnnxOnlineRecognizer * | recognizer | ) |
One stream corresponds to one decoding state. Reuse the same recognizer to create multiple streams.
| recognizer | A pointer returned by SherpaOnnxCreateOnlineRecognizer(). |
References SHERPA_ONNX_API.
| const SherpaOnnxOnlineStream * SherpaOnnxCreateOnlineStreamWithHotwords | ( | const SherpaOnnxOnlineRecognizer * | recognizer, |
| const char * | hotwords ) |
| recognizer | A pointer returned by SherpaOnnxCreateOnlineRecognizer(). |
| hotwords | Hotwords text to associate with the stream. |
| const SherpaOnnxSpeakerEmbeddingExtractor * SherpaOnnxCreateSpeakerEmbeddingExtractor | ( | const SherpaOnnxSpeakerEmbeddingExtractorConfig * | config | ) |
| config | Speaker embedding extractor configuration. |
| const SherpaOnnxSpeakerEmbeddingManager * SherpaOnnxCreateSpeakerEmbeddingManager | ( | int32_t | dim | ) |
The manager stores enrolled speaker embeddings and supports speaker search and verification.
| dim | Embedding dimension. This should match SherpaOnnxSpeakerEmbeddingExtractorDim(). |
| const SherpaOnnxSpokenLanguageIdentification * SherpaOnnxCreateSpokenLanguageIdentification | ( | const SherpaOnnxSpokenLanguageIdentificationConfig * | config | ) |
| config | Spoken-language identification configuration. |
| const SherpaOnnxVoiceActivityDetector * SherpaOnnxCreateVoiceActivityDetector | ( | const SherpaOnnxVadModelConfig * | config, |
| float | buffer_size_in_seconds ) |
Example model files are shown in c-api-examples/vad-whisper-c-api.c.
| config | VAD configuration. |
| buffer_size_in_seconds | Internal buffering capacity in seconds. |
| void SherpaOnnxDecodeKeywordStream | ( | const SherpaOnnxKeywordSpotter * | spotter, |
| const SherpaOnnxOnlineStream * | stream ) |
Call this only when SherpaOnnxIsKeywordStreamReady() returns 1.
| spotter | A pointer returned by SherpaOnnxCreateKeywordSpotter(). |
| stream | A pointer returned by SherpaOnnxCreateKeywordStream() or SherpaOnnxCreateKeywordStreamWithKeywords(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDecodeMultipleKeywordStreams | ( | const SherpaOnnxKeywordSpotter * | spotter, |
| const SherpaOnnxOnlineStream ** | streams, | ||
| int32_t | n ) |
The caller must ensure every stream in streams is ready before calling this function.
| spotter | A pointer returned by SherpaOnnxCreateKeywordSpotter(). |
| streams | Array of ready streams. |
| n | Number of elements in streams. |
References SHERPA_ONNX_API.
| void SherpaOnnxDecodeMultipleOfflineStreams | ( | const SherpaOnnxOfflineRecognizer * | recognizer, |
| const SherpaOnnxOfflineStream ** | streams, | ||
| int32_t | n ) |
The caller must have already provided one utterance to each stream via SherpaOnnxAcceptWaveformOffline().
| recognizer | A pointer returned by SherpaOnnxCreateOfflineRecognizer(). |
| streams | Array of n offline stream pointers. |
| n | Number of streams in streams. |
References SHERPA_ONNX_API.
| void SherpaOnnxDecodeMultipleOnlineStreams | ( | const SherpaOnnxOnlineRecognizer * | recognizer, |
| const SherpaOnnxOnlineStream ** | streams, | ||
| int32_t | n ) |
The caller must ensure every stream in streams is ready before calling this function.
| recognizer | A pointer returned by SherpaOnnxCreateOnlineRecognizer(). |
| streams | Array of n stream pointers. |
| n | Number of streams in streams. |
References SHERPA_ONNX_API.
| void SherpaOnnxDecodeOfflineStream | ( | const SherpaOnnxOfflineRecognizer * | recognizer, |
| const SherpaOnnxOfflineStream * | stream ) |
Call this after SherpaOnnxAcceptWaveformOffline().
| recognizer | A pointer returned by SherpaOnnxCreateOfflineRecognizer(). |
| stream | A pointer returned by SherpaOnnxCreateOfflineStream(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDecodeOnlineStream | ( | const SherpaOnnxOnlineRecognizer * | recognizer, |
| const SherpaOnnxOnlineStream * | stream ) |
Call this only when SherpaOnnxIsOnlineStreamReady() returns 1.
| recognizer | A pointer returned by SherpaOnnxCreateOnlineRecognizer(). |
| stream | A pointer returned by SherpaOnnxCreateOnlineStream(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyAudioTagging | ( | const SherpaOnnxAudioTagging * | tagger | ) |
| tagger | A pointer returned by SherpaOnnxCreateAudioTagging(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyCircularBuffer | ( | const SherpaOnnxCircularBuffer * | buffer | ) |
| buffer | A pointer returned by SherpaOnnxCreateCircularBuffer(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyDenoisedAudio | ( | const SherpaOnnxDenoisedAudio * | p | ) |
| p | A pointer returned by SherpaOnnxOfflineSpeechDenoiserRun(), SherpaOnnxOnlineSpeechDenoiserRun(), or SherpaOnnxOnlineSpeechDenoiserFlush(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyDisplay | ( | const SherpaOnnxDisplay * | display | ) |
| display | A pointer returned by SherpaOnnxCreateDisplay(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyForcedAligner | ( | const SherpaOnnxForcedAligner * | aligner | ) |
| aligner | A pointer returned by SherpaOnnxCreateForcedAligner(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyForcedAlignmentResult | ( | const SherpaOnnxForcedAlignmentResult * | result | ) |
| result | A pointer returned by SherpaOnnxForcedAlignerCompute(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyKeywordResult | ( | const SherpaOnnxKeywordResult * | r | ) |
| r | A pointer returned by SherpaOnnxGetKeywordResult(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyKeywordSpotter | ( | const SherpaOnnxKeywordSpotter * | spotter | ) |
| spotter | A pointer returned by SherpaOnnxCreateKeywordSpotter(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyLinearResampler | ( | const SherpaOnnxLinearResampler * | p | ) |
| p | A pointer returned by SherpaOnnxCreateLinearResampler(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyOfflineDiacritization | ( | const SherpaOnnxOfflineDiacritization * | diacrt | ) |
| diacrt | A pointer returned by SherpaOnnxCreateOfflineDiacritization(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyOfflinePunctuation | ( | const SherpaOnnxOfflinePunctuation * | punct | ) |
| punct | A pointer returned by SherpaOnnxCreateOfflinePunctuation(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyOfflineRecognizer | ( | const SherpaOnnxOfflineRecognizer * | recognizer | ) |
| recognizer | A pointer returned by SherpaOnnxCreateOfflineRecognizer(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyOfflineRecognizerResult | ( | const SherpaOnnxOfflineRecognizerResult * | r | ) |
| r | A pointer returned by SherpaOnnxGetOfflineStreamResult(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyOfflineSourceSeparation | ( | const SherpaOnnxOfflineSourceSeparation * | ss | ) |
| ss | A pointer returned by SherpaOnnxCreateOfflineSourceSeparation(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyOfflineSpeakerDiarization | ( | const SherpaOnnxOfflineSpeakerDiarization * | sd | ) |
| sd | A pointer returned by SherpaOnnxCreateOfflineSpeakerDiarization(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyOfflineSpeechDenoiser | ( | const SherpaOnnxOfflineSpeechDenoiser * | sd | ) |
| sd | A pointer returned by SherpaOnnxCreateOfflineSpeechDenoiser(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyOfflineStream | ( | const SherpaOnnxOfflineStream * | stream | ) |
| stream | A pointer returned by SherpaOnnxCreateOfflineStream() or SherpaOnnxCreateOfflineStreamWithHotwords(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyOfflineStreamResultJson | ( | const char * | s | ) |
| s | A pointer returned by SherpaOnnxGetOfflineStreamResultAsJson(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyOfflineTts | ( | const SherpaOnnxOfflineTts * | tts | ) |
| tts | A pointer returned by SherpaOnnxCreateOfflineTts(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyOfflineTtsGeneratedAudio | ( | const SherpaOnnxGeneratedAudio * | p | ) |
| p | A pointer returned by one of the SherpaOnnxOfflineTtsGenerate* functions. |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyOfflineTtsLang | ( | const char * | s | ) |
| s | A pointer returned by SherpaOnnxOfflineTtsLang(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyOnlinePunctuation | ( | const SherpaOnnxOnlinePunctuation * | punctuation | ) |
| punctuation | A pointer returned by SherpaOnnxCreateOnlinePunctuation(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyOnlineRecognizer | ( | const SherpaOnnxOnlineRecognizer * | recognizer | ) |
| recognizer | A pointer returned by SherpaOnnxCreateOnlineRecognizer(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyOnlineRecognizerResult | ( | const SherpaOnnxOnlineRecognizerResult * | r | ) |
| r | A pointer returned by SherpaOnnxGetOnlineStreamResult(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyOnlineSpeechDenoiser | ( | const SherpaOnnxOnlineSpeechDenoiser * | sd | ) |
| sd | A pointer returned by SherpaOnnxCreateOnlineSpeechDenoiser(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyOnlineStream | ( | const SherpaOnnxOnlineStream * | stream | ) |
| stream | A pointer returned by SherpaOnnxCreateOnlineStream() or SherpaOnnxCreateOnlineStreamWithHotwords(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyOnlineStreamResultJson | ( | const char * | s | ) |
| s | A pointer returned by SherpaOnnxGetOnlineStreamResultAsJson(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroySourceSeparationOutput | ( | const SherpaOnnxSourceSeparationOutput * | p | ) |
| p | A pointer returned by SherpaOnnxOfflineSourceSeparationProcess(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroySpeakerEmbeddingExtractor | ( | const SherpaOnnxSpeakerEmbeddingExtractor * | p | ) |
| p | A pointer returned by SherpaOnnxCreateSpeakerEmbeddingExtractor(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroySpeakerEmbeddingManager | ( | const SherpaOnnxSpeakerEmbeddingManager * | p | ) |
| p | A pointer returned by SherpaOnnxCreateSpeakerEmbeddingManager(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroySpeechSegment | ( | const SherpaOnnxSpeechSegment * | p | ) |
| p | A pointer returned by SherpaOnnxVoiceActivityDetectorFront(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroySpokenLanguageIdentification | ( | const SherpaOnnxSpokenLanguageIdentification * | slid | ) |
| slid | A pointer returned by SherpaOnnxCreateSpokenLanguageIdentification(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroySpokenLanguageIdentificationResult | ( | const SherpaOnnxSpokenLanguageIdentificationResult * | r | ) |
| r | A pointer returned by SherpaOnnxSpokenLanguageIdentificationCompute(). |
References SHERPA_ONNX_API.
| void SherpaOnnxDestroyVoiceActivityDetector | ( | const SherpaOnnxVoiceActivityDetector * | p | ) |
| p | A pointer returned by SherpaOnnxCreateVoiceActivityDetector(). |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxFileExists | ( | const char * | filename | ) |
| filename | File path to test. |
References SHERPA_ONNX_API.
| const SherpaOnnxForcedAlignmentResult * SherpaOnnxForcedAlignerCompute | ( | const SherpaOnnxForcedAligner * | aligner, |
| const SherpaOnnxOfflineStream * | stream, | ||
| const char * | text ) |
| aligner | A pointer returned by SherpaOnnxCreateForcedAligner(). |
| stream | A stream returned by SherpaOnnxForcedAlignerCreateStream() and filled with a waveform. |
| text | The transcript of the whole utterance. Hanzi text is tokenized per character (multi-character dictionary keys give pronunciation context); anything else is split on whitespace. Punctuation is ignored. |
| SherpaOnnxOfflineStream * SherpaOnnxForcedAlignerCreateStream | ( | const SherpaOnnxForcedAligner * | aligner | ) |
Fill the stream with SherpaOnnxAcceptWaveformOffline(), then pass it to SherpaOnnxForcedAlignerCompute().
| aligner | A pointer returned by SherpaOnnxCreateForcedAligner(). |
References SHERPA_ONNX_API.
| void SherpaOnnxFreeKeywordResultJson | ( | const char * | s | ) |
| s | A pointer returned by SherpaOnnxGetKeywordResultAsJson(). |
References SHERPA_ONNX_API.
| void SherpaOnnxFreeMultiChannelWave | ( | const SherpaOnnxMultiChannelWave * | wave | ) |
| wave | A pointer returned by SherpaOnnxReadWaveMultiChannel(). |
References SHERPA_ONNX_API.
| void SherpaOnnxFreeWave | ( | const SherpaOnnxWave * | wave | ) |
References SHERPA_ONNX_API.
| const char * SherpaOnnxGetGitDate | ( | ) |
The returned pointer refers to statically allocated memory owned by the library. Do not free it and do not modify it.
References SHERPA_ONNX_API.
| const char * SherpaOnnxGetGitSha1 | ( | ) |
The returned pointer refers to statically allocated memory owned by the library. Do not free it and do not modify it.
References SHERPA_ONNX_API.
| const SherpaOnnxKeywordResult * SherpaOnnxGetKeywordResult | ( | const SherpaOnnxKeywordSpotter * | spotter, |
| const SherpaOnnxOnlineStream * | stream ) |
The returned snapshot may represent either "no trigger yet" or a detected keyword. A common pattern is to check whether strlen(r->keyword) != 0.
| spotter | A pointer returned by SherpaOnnxCreateKeywordSpotter(). |
| stream | A pointer returned by SherpaOnnxCreateKeywordStream() or SherpaOnnxCreateKeywordStreamWithKeywords(). |
References SHERPA_ONNX_API.
| const char * SherpaOnnxGetKeywordResultAsJson | ( | const SherpaOnnxKeywordSpotter * | spotter, |
| const SherpaOnnxOnlineStream * | stream ) |
| spotter | A pointer returned by SherpaOnnxCreateKeywordSpotter(). |
| stream | A pointer returned by SherpaOnnxCreateKeywordStream() or SherpaOnnxCreateKeywordStreamWithKeywords(). |
References SHERPA_ONNX_API.
| const SherpaOnnxOfflineRecognizerResult * SherpaOnnxGetOfflineStreamResult | ( | const SherpaOnnxOfflineStream * | stream | ) |
Call this after SherpaOnnxDecodeOfflineStream() or SherpaOnnxDecodeMultipleOfflineStreams().
| stream | A pointer returned by SherpaOnnxCreateOfflineStream(). |
| const char * SherpaOnnxGetOfflineStreamResultAsJson | ( | const SherpaOnnxOfflineStream * | stream | ) |
| stream | A pointer returned by SherpaOnnxCreateOfflineStream(). |
References SHERPA_ONNX_API.
| const SherpaOnnxOnlineRecognizerResult * SherpaOnnxGetOnlineStreamResult | ( | const SherpaOnnxOnlineRecognizer * | recognizer, |
| const SherpaOnnxOnlineStream * | stream ) |
The returned snapshot is independent from the stream state. The caller owns it and must free it with SherpaOnnxDestroyOnlineRecognizerResult().
| recognizer | A pointer returned by SherpaOnnxCreateOnlineRecognizer(). |
| stream | A pointer returned by SherpaOnnxCreateOnlineStream(). |
| const char * SherpaOnnxGetOnlineStreamResultAsJson | ( | const SherpaOnnxOnlineRecognizer * | recognizer, |
| const SherpaOnnxOnlineStream * | stream ) |
| recognizer | A pointer returned by SherpaOnnxCreateOnlineRecognizer(). |
| stream | A pointer returned by SherpaOnnxCreateOnlineStream(). |
References SHERPA_ONNX_API.
| const char * SherpaOnnxGetOnnxruntimeVersionStr | ( | ) |
The returned pointer refers to statically allocated memory owned by the library. Do not free it and do not modify it.
References SHERPA_ONNX_API.
| const char * SherpaOnnxGetVersionStr | ( | ) |
The returned pointer refers to statically allocated memory owned by the library. Do not free it and do not modify it.
References SHERPA_ONNX_API.
| int32_t SherpaOnnxIsKeywordStreamReady | ( | const SherpaOnnxKeywordSpotter * | spotter, |
| const SherpaOnnxOnlineStream * | stream ) |
| spotter | A pointer returned by SherpaOnnxCreateKeywordSpotter(). |
| stream | A pointer returned by SherpaOnnxCreateKeywordStream() or SherpaOnnxCreateKeywordStreamWithKeywords(). |
| int32_t SherpaOnnxIsOnlineStreamReady | ( | const SherpaOnnxOnlineRecognizer * | recognizer, |
| const SherpaOnnxOnlineStream * | stream ) |
| recognizer | A pointer returned by SherpaOnnxCreateOnlineRecognizer(). |
| stream | A pointer returned by SherpaOnnxCreateOnlineStream(). |
| const SherpaOnnxResampleOut * SherpaOnnxLinearResamplerResample | ( | const SherpaOnnxLinearResampler * | p, |
| const float * | input, | ||
| int32_t | input_dim, | ||
| int32_t | flush ) |
Set flush to 1 for the final chunk so buffered samples are emitted.
| p | A pointer returned by SherpaOnnxCreateLinearResampler(). |
| input | Input sample array. |
| input_dim | Number of input samples. |
| flush | 1 if this is the final chunk; otherwise 0. |
References SHERPA_ONNX_API.
| void SherpaOnnxLinearResamplerResampleFree | ( | const SherpaOnnxResampleOut * | p | ) |
| p | A pointer returned by SherpaOnnxLinearResamplerResample(). |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxLinearResamplerResampleGetInputSampleRate | ( | const SherpaOnnxLinearResampler * | p | ) |
| p | A pointer returned by SherpaOnnxCreateLinearResampler(). |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxLinearResamplerResampleGetOutputSampleRate | ( | const SherpaOnnxLinearResampler * | p | ) |
| p | A pointer returned by SherpaOnnxCreateLinearResampler(). |
References SHERPA_ONNX_API.
| void SherpaOnnxLinearResamplerReset | ( | const SherpaOnnxLinearResampler * | p | ) |
| p | A pointer returned by SherpaOnnxCreateLinearResampler(). |
References SHERPA_ONNX_API.
| void SherpaOnnxOfflineRecognizerSetConfig | ( | const SherpaOnnxOfflineRecognizer * | recognizer, |
| const SherpaOnnxOfflineRecognizerConfig * | config ) |
| recognizer | Recognizer handle. |
| config | New recognizer configuration. |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxOfflineSourceSeparationGetNumberOfStems | ( | const SherpaOnnxOfflineSourceSeparation * | ss | ) |
For Spleeter 2-stems this returns 2 (vocals + accompaniment).
| ss | A pointer returned by SherpaOnnxCreateOfflineSourceSeparation(). |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxOfflineSourceSeparationGetOutputSampleRate | ( | const SherpaOnnxOfflineSourceSeparation * | ss | ) |
| ss | A pointer returned by SherpaOnnxCreateOfflineSourceSeparation(). |
References SHERPA_ONNX_API.
| const SherpaOnnxSourceSeparationOutput * SherpaOnnxOfflineSourceSeparationProcess | ( | const SherpaOnnxOfflineSourceSeparation * | ss, |
| const float *const * | samples, | ||
| int32_t | num_channels, | ||
| int32_t | num_samples, | ||
| int32_t | sample_rate ) |
All input channels must have the same number of samples.
| ss | A pointer returned by SherpaOnnxCreateOfflineSourceSeparation(). |
| samples | samples[c] is a float array for channel c, values in [-1, 1]. |
| num_channels | Number of input channels. |
| num_samples | Number of samples per channel (all channels must have the same length). |
| sample_rate | Input sample rate in Hz. |
| void SherpaOnnxOfflineSpeakerDiarizationDestroyResult | ( | const SherpaOnnxOfflineSpeakerDiarizationResult * | r | ) |
| r | A pointer returned by one of the SherpaOnnxOfflineSpeakerDiarizationProcess*() functions. |
References SHERPA_ONNX_API.
| void SherpaOnnxOfflineSpeakerDiarizationDestroySegment | ( | const SherpaOnnxOfflineSpeakerDiarizationSegment * | s | ) |
| s | A pointer returned by SherpaOnnxOfflineSpeakerDiarizationResultSortByStartTime(). |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxOfflineSpeakerDiarizationGetSampleRate | ( | const SherpaOnnxOfflineSpeakerDiarization * | sd | ) |
| sd | A pointer returned by SherpaOnnxCreateOfflineSpeakerDiarization(). |
References SHERPA_ONNX_API.
| const SherpaOnnxOfflineSpeakerDiarizationResult * SherpaOnnxOfflineSpeakerDiarizationProcess | ( | const SherpaOnnxOfflineSpeakerDiarization * | sd, |
| const float * | samples, | ||
| int32_t | n ) |
| sd | A pointer returned by SherpaOnnxCreateOfflineSpeakerDiarization(). |
| samples | Input mono PCM samples normalized to [-1, 1]. |
| n | Number of input samples. |
References SHERPA_ONNX_API.
| const SherpaOnnxOfflineSpeakerDiarizationResult * SherpaOnnxOfflineSpeakerDiarizationProcessWithCallback | ( | const SherpaOnnxOfflineSpeakerDiarization * | sd, |
| const float * | samples, | ||
| int32_t | n, | ||
| SherpaOnnxOfflineSpeakerDiarizationProgressCallback | callback, | ||
| void * | arg ) |
| sd | A pointer returned by SherpaOnnxCreateOfflineSpeakerDiarization(). |
| samples | Input mono PCM samples normalized to [-1, 1]. |
| n | Number of input samples. |
| callback | Progress callback. |
| arg | User pointer forwarded to callback. |
References SHERPA_ONNX_API.
| const SherpaOnnxOfflineSpeakerDiarizationResult * SherpaOnnxOfflineSpeakerDiarizationProcessWithCallbackNoArg | ( | const SherpaOnnxOfflineSpeakerDiarization * | sd, |
| const float * | samples, | ||
| int32_t | n, | ||
| SherpaOnnxOfflineSpeakerDiarizationProgressCallbackNoArg | callback ) |
| sd | A pointer returned by SherpaOnnxCreateOfflineSpeakerDiarization(). |
| samples | Input mono PCM samples normalized to [-1, 1]. |
| n | Number of input samples. |
| callback | Progress callback. |
| int32_t SherpaOnnxOfflineSpeakerDiarizationResultGetNumSegments | ( | const SherpaOnnxOfflineSpeakerDiarizationResult * | r | ) |
| r | A pointer returned by one of the SherpaOnnxOfflineSpeakerDiarizationProcess*() functions. |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxOfflineSpeakerDiarizationResultGetNumSpeakers | ( | const SherpaOnnxOfflineSpeakerDiarizationResult * | r | ) |
| r | A pointer returned by one of the SherpaOnnxOfflineSpeakerDiarizationProcess*() functions. |
References SHERPA_ONNX_API.
| const SherpaOnnxOfflineSpeakerDiarizationSegment * SherpaOnnxOfflineSpeakerDiarizationResultSortByStartTime | ( | const SherpaOnnxOfflineSpeakerDiarizationResult * | r | ) |
The returned array contains exactly SherpaOnnxOfflineSpeakerDiarizationResultGetNumSegments() entries.
| r | A pointer returned by one of the SherpaOnnxOfflineSpeakerDiarizationProcess*() functions. |
| void SherpaOnnxOfflineSpeakerDiarizationSetConfig | ( | const SherpaOnnxOfflineSpeakerDiarization * | sd, |
| const SherpaOnnxOfflineSpeakerDiarizationConfig * | config ) |
Only config->clustering is used. Other fields are ignored.
| sd | A pointer returned by SherpaOnnxCreateOfflineSpeakerDiarization(). |
| config | Configuration whose clustering field will be applied. |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxOfflineSpeechDenoiserGetSampleRate | ( | const SherpaOnnxOfflineSpeechDenoiser * | sd | ) |
| sd | A pointer returned by SherpaOnnxCreateOfflineSpeechDenoiser(). |
References SHERPA_ONNX_API.
| const SherpaOnnxDenoisedAudio * SherpaOnnxOfflineSpeechDenoiserRun | ( | const SherpaOnnxOfflineSpeechDenoiser * | sd, |
| const float * | samples, | ||
| int32_t | n, | ||
| int32_t | sample_rate ) |
| sd | A pointer returned by SherpaOnnxCreateOfflineSpeechDenoiser(). |
| samples | Input mono PCM samples normalized to [-1, 1]. |
| n | Number of input samples. |
| sample_rate | Input sample rate in Hz. |
| int32_t SherpaOnnxOfflineSpeechDenoiserSetVoiceSample | ( | const SherpaOnnxOfflineSpeechDenoiser * | sd, |
| const float * | samples, | ||
| int32_t | n, | ||
| int32_t | sample_rate ) |
After resampling to the model rate, it keeps the loudest 3 seconds within the first 30 seconds. Returns -1 if the clip is shorter than 3 seconds after resampling; the previous voice sample is left unchanged.
| sd | A pointer returned by SherpaOnnxCreateOfflineSpeechDenoiser(). |
| samples | Input mono PCM samples normalized to [-1, 1]. |
| n | Number of input samples. |
| sample_rate | Input sample rate in Hz. |
References SHERPA_ONNX_API.
| const char * SherpaOnnxOfflineStreamGetOption | ( | const SherpaOnnxOfflineStream * | stream, |
| const char * | key ) |
| stream | A pointer returned by SherpaOnnxCreateOfflineStream(). |
| key | Option name. |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxOfflineStreamHasOption | ( | const SherpaOnnxOfflineStream * | stream, |
| const char * | key ) |
| stream | A pointer returned by SherpaOnnxCreateOfflineStream(). |
| key | Option name. |
References SHERPA_ONNX_API.
| void SherpaOnnxOfflineStreamSetOption | ( | const SherpaOnnxOfflineStream * | stream, |
| const char * | key, | ||
| const char * | value ) |
| stream | A pointer returned by SherpaOnnxCreateOfflineStream(). |
| key | Option name. |
| value | Option value represented as text. |
References SHERPA_ONNX_API.
| const SherpaOnnxGeneratedAudio * SherpaOnnxOfflineTtsGenerate | ( | const SherpaOnnxOfflineTts * | tts, |
| const char * | text, | ||
| int32_t | sid, | ||
| float | speed ) |
| tts | A pointer returned by SherpaOnnxCreateOfflineTts(). |
| text | Input text. |
| sid | Speaker ID for multi-speaker models. |
| speed | Speech rate. Values > 1 are faster. |
References SHERPA_ONNX_API, and SherpaOnnxOfflineTtsGenerate().
Referenced by SherpaOnnxOfflineTtsGenerate().
| const SherpaOnnxGeneratedAudio * SherpaOnnxOfflineTtsGenerateWithCallback | ( | const SherpaOnnxOfflineTts * | tts, |
| const char * | text, | ||
| int32_t | sid, | ||
| float | speed, | ||
| SherpaOnnxGeneratedAudioCallback | callback ) |
The callback receives newly generated samples. The sample pointer is valid only for the duration of the callback.
| tts | A pointer returned by SherpaOnnxCreateOfflineTts(). |
| text | Input text. |
| sid | Speaker ID for multi-speaker models. |
| speed | Speech rate. Values > 1 are faster. |
| callback | Incremental callback. Return 0 to stop generation early. |
References SHERPA_ONNX_API, and SherpaOnnxOfflineTtsGenerateWithCallback().
Referenced by SherpaOnnxOfflineTtsGenerateWithCallback().
| const SherpaOnnxGeneratedAudio * SherpaOnnxOfflineTtsGenerateWithCallbackWithArg | ( | const SherpaOnnxOfflineTts * | tts, |
| const char * | text, | ||
| int32_t | sid, | ||
| float | speed, | ||
| SherpaOnnxGeneratedAudioCallbackWithArg | callback, | ||
| void * | arg ) |
| tts | A pointer returned by SherpaOnnxCreateOfflineTts(). |
| text | Input text. |
| sid | Speaker ID for multi-speaker models. |
| speed | Speech rate. Values > 1 are faster. |
| callback | Incremental callback with user pointer. |
| arg | User pointer forwarded to callback. |
References SHERPA_ONNX_API, and SherpaOnnxOfflineTtsGenerateWithCallbackWithArg().
Referenced by SherpaOnnxOfflineTtsGenerateWithCallbackWithArg().
| const SherpaOnnxGeneratedAudio * SherpaOnnxOfflineTtsGenerateWithConfig | ( | const SherpaOnnxOfflineTts * | tts, |
| const char * | text, | ||
| const SherpaOnnxGenerationConfig * | config, | ||
| SherpaOnnxGeneratedAudioProgressCallbackWithArg | callback, | ||
| void * | arg ) |
This is the preferred API for new integrations. It supports callback-based progress reporting and model-specific options such as reference audio.
| tts | A pointer returned by SherpaOnnxCreateOfflineTts(). |
| text | Input text. |
| config | Generation-time configuration. |
| callback | Optional progress callback with user pointer. Return 0 to stop early. |
| arg | User pointer forwarded to callback. |
| const SherpaOnnxGeneratedAudio * SherpaOnnxOfflineTtsGenerateWithProgressCallback | ( | const SherpaOnnxOfflineTts * | tts, |
| const char * | text, | ||
| int32_t | sid, | ||
| float | speed, | ||
| SherpaOnnxGeneratedAudioProgressCallback | callback ) |
| tts | A pointer returned by SherpaOnnxCreateOfflineTts(). |
| text | Input text. |
| sid | Speaker ID for multi-speaker models. |
| speed | Speech rate. Values > 1 are faster. |
| callback | Progress callback. Return 0 to stop generation early. |
References SHERPA_ONNX_API, and SherpaOnnxOfflineTtsGenerateWithProgressCallback().
Referenced by SherpaOnnxOfflineTtsGenerateWithProgressCallback().
| const SherpaOnnxGeneratedAudio * SherpaOnnxOfflineTtsGenerateWithProgressCallbackWithArg | ( | const SherpaOnnxOfflineTts * | tts, |
| const char * | text, | ||
| int32_t | sid, | ||
| float | speed, | ||
| SherpaOnnxGeneratedAudioProgressCallbackWithArg | callback, | ||
| void * | arg ) |
| tts | A pointer returned by SherpaOnnxCreateOfflineTts(). |
| text | Input text. |
| sid | Speaker ID for multi-speaker models. |
| speed | Speech rate. Values > 1 are faster. |
| callback | Progress callback with user pointer. Return 0 to stop early. |
| arg | User pointer forwarded to callback. |
References SHERPA_ONNX_API, and SherpaOnnxOfflineTtsGenerateWithProgressCallbackWithArg().
Referenced by SherpaOnnxOfflineTtsGenerateWithProgressCallbackWithArg().
| const SherpaOnnxGeneratedAudio * SherpaOnnxOfflineTtsGenerateWithZipvoice | ( | const SherpaOnnxOfflineTts * | tts, |
| const char * | text, | ||
| const char * | prompt_text, | ||
| const float * | prompt_samples, | ||
| int32_t | n_prompt, | ||
| int32_t | prompt_sr, | ||
| float | speed, | ||
| int32_t | num_steps ) |
Use SherpaOnnxOfflineTtsGenerateWithConfig() instead.
References SherpaOnnxOfflineTtsGenerateWithZipvoice().
Referenced by SherpaOnnxOfflineTtsGenerateWithZipvoice().
| const char * SherpaOnnxOfflineTtsLang | ( | const SherpaOnnxOfflineTts * | tts | ) |
The returned string is empty if such information is not available. It is never NULL; free it with SherpaOnnxDestroyOfflineTtsLang().
| tts | A pointer returned by SherpaOnnxCreateOfflineTts(). |
| int32_t SherpaOnnxOfflineTtsNumSpeakers | ( | const SherpaOnnxOfflineTts * | tts | ) |
Single-speaker models often return 1.
| tts | A pointer returned by SherpaOnnxCreateOfflineTts(). |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxOfflineTtsSampleRate | ( | const SherpaOnnxOfflineTts * | tts | ) |
| tts | A pointer returned by SherpaOnnxCreateOfflineTts(). |
References SHERPA_ONNX_API.
| const char * SherpaOnnxOnlinePunctuationAddPunct | ( | const SherpaOnnxOnlinePunctuation * | punctuation, |
| const char * | text ) |
| punctuation | A pointer returned by SherpaOnnxCreateOnlinePunctuation(). |
| text | Input text chunk. |
References SHERPA_ONNX_API.
| void SherpaOnnxOnlinePunctuationFreeText | ( | const char * | text | ) |
| text | A pointer returned by SherpaOnnxOnlinePunctuationAddPunct(). |
References SHERPA_ONNX_API.
| const SherpaOnnxDenoisedAudio * SherpaOnnxOnlineSpeechDenoiserFlush | ( | const SherpaOnnxOnlineSpeechDenoiser * | sd | ) |
This also resets the denoiser so it can be reused for a new utterance.
| sd | A pointer returned by SherpaOnnxCreateOnlineSpeechDenoiser(). |
| int32_t SherpaOnnxOnlineSpeechDenoiserGetFrameShiftInSamples | ( | const SherpaOnnxOnlineSpeechDenoiser * | sd | ) |
Example programs feed audio to the online denoiser in this chunk size.
| sd | A pointer returned by SherpaOnnxCreateOnlineSpeechDenoiser(). |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxOnlineSpeechDenoiserGetSampleRate | ( | const SherpaOnnxOnlineSpeechDenoiser * | sd | ) |
| sd | A pointer returned by SherpaOnnxCreateOnlineSpeechDenoiser(). |
References SHERPA_ONNX_API.
| void SherpaOnnxOnlineSpeechDenoiserReset | ( | const SherpaOnnxOnlineSpeechDenoiser * | sd | ) |
| sd | A pointer returned by SherpaOnnxCreateOnlineSpeechDenoiser(). |
References SHERPA_ONNX_API.
| const SherpaOnnxDenoisedAudio * SherpaOnnxOnlineSpeechDenoiserRun | ( | const SherpaOnnxOnlineSpeechDenoiser * | sd, |
| const float * | samples, | ||
| int32_t | n, | ||
| int32_t | sample_rate ) |
This function is not thread-safe. It may return NULL when not enough input has been accumulated to produce denoised output yet.
| sd | A pointer returned by SherpaOnnxCreateOnlineSpeechDenoiser(). |
| samples | Input chunk normalized to [-1, 1]. |
| n | Number of input samples. |
| sample_rate | Input sample rate in Hz. |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxOnlineSpeechDenoiserSetVoiceSample | ( | const SherpaOnnxOnlineSpeechDenoiser * | sd, |
| const float * | samples, | ||
| int32_t | n, | ||
| int32_t | sample_rate ) |
See SherpaOnnxOfflineSpeechDenoiserSetVoiceSample(). On success the denoiser is reset so it uses the new clip.
| sd | A pointer returned by SherpaOnnxCreateOnlineSpeechDenoiser(). |
| samples | Input mono PCM samples normalized to [-1, 1]. |
| n | Number of input samples. |
| sample_rate | Input sample rate in Hz. |
References SHERPA_ONNX_API.
| void SherpaOnnxOnlineStreamAcceptWaveform | ( | const SherpaOnnxOnlineStream * | stream, |
| int32_t | sample_rate, | ||
| const float * | samples, | ||
| int32_t | n ) |
The input is mono floating-point PCM normalized to the range [-1, 1]. If sample_rate differs from the recognizer feature sample rate, sherpa-onnx resamples internally.
| stream | A pointer returned by SherpaOnnxCreateOnlineStream(). |
| sample_rate | Sample rate of samples. |
| samples | Pointer to n samples in the range [-1, 1]. |
| n | Number of samples. |
References SHERPA_ONNX_API.
| const char * SherpaOnnxOnlineStreamGetOption | ( | const SherpaOnnxOnlineStream * | stream, |
| const char * | key ) |
| stream | A pointer returned by SherpaOnnxCreateOnlineStream(). |
| key | Option name. |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxOnlineStreamHasOption | ( | const SherpaOnnxOnlineStream * | stream, |
| const char * | key ) |
| stream | A pointer returned by SherpaOnnxCreateOnlineStream(). |
| key | Option name. |
References SHERPA_ONNX_API.
| void SherpaOnnxOnlineStreamInputFinished | ( | const SherpaOnnxOnlineStream * | stream | ) |
After calling this function, do not append more samples to the stream.
| stream | A pointer returned by SherpaOnnxCreateOnlineStream(). |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxOnlineStreamIsEndpoint | ( | const SherpaOnnxOnlineRecognizer * | recognizer, |
| const SherpaOnnxOnlineStream * | stream ) |
| recognizer | A pointer returned by SherpaOnnxCreateOnlineRecognizer(). |
| stream | A pointer returned by SherpaOnnxCreateOnlineStream(). |
| void SherpaOnnxOnlineStreamReset | ( | const SherpaOnnxOnlineRecognizer * | recognizer, |
| const SherpaOnnxOnlineStream * | stream ) |
This clears the decoder state for the stream so that it can be reused for a new utterance.
| recognizer | A pointer returned by SherpaOnnxCreateOnlineRecognizer(). |
| stream | A pointer returned by SherpaOnnxCreateOnlineStream(). |
References SHERPA_ONNX_API.
| void SherpaOnnxOnlineStreamSetOption | ( | const SherpaOnnxOnlineStream * | stream, |
| const char * | key, | ||
| const char * | value ) |
This is a generic extension point for model-specific or runtime-specific options such as "is_final" for streaming Paraformer.
| stream | A pointer returned by SherpaOnnxCreateOnlineStream(). |
| key | Option name. |
| value | Option value represented as text. |
References SHERPA_ONNX_API.
| void SherpaOnnxPrint | ( | const SherpaOnnxDisplay * | display, |
| int32_t | idx, | ||
| const char * | s ) |
| display | A pointer returned by SherpaOnnxCreateDisplay(). |
| idx | Segment or utterance index to print. |
| s | Text to print. |
References SHERPA_ONNX_API.
| const SherpaOnnxWave * SherpaOnnxReadWave | ( | const char * | filename | ) |
| filename | Input WAVE filename. |
References SHERPA_ONNX_API.
| const SherpaOnnxWave * SherpaOnnxReadWaveFromBinaryData | ( | const char * | data, |
| int32_t | n ) |
| data | Pointer to the WAVE file bytes. |
| n | Size of data in bytes. |
References SHERPA_ONNX_API.
| const SherpaOnnxMultiChannelWave * SherpaOnnxReadWaveMultiChannel | ( | const char * | filename | ) |
| filename | Input WAVE filename. |
| void SherpaOnnxResetKeywordStream | ( | const SherpaOnnxKeywordSpotter * | spotter, |
| const SherpaOnnxOnlineStream * | stream ) |
The examples call this immediately after a successful trigger so the next keyword can be detected independently.
| spotter | A pointer returned by SherpaOnnxCreateKeywordSpotter(). |
| stream | A pointer returned by SherpaOnnxCreateKeywordStream() or SherpaOnnxCreateKeywordStreamWithKeywords(). |
References SHERPA_ONNX_API.
| const float * SherpaOnnxSpeakerEmbeddingExtractorComputeEmbedding | ( | const SherpaOnnxSpeakerEmbeddingExtractor * | p, |
| const SherpaOnnxOnlineStream * | s ) |
The returned vector has SherpaOnnxSpeakerEmbeddingExtractorDim(p) elements. Free it with SherpaOnnxSpeakerEmbeddingExtractorDestroyEmbedding().
| p | A pointer returned by SherpaOnnxCreateSpeakerEmbeddingExtractor(). |
| s | A pointer returned by SherpaOnnxSpeakerEmbeddingExtractorCreateStream(). |
| const SherpaOnnxOnlineStream * SherpaOnnxSpeakerEmbeddingExtractorCreateStream | ( | const SherpaOnnxSpeakerEmbeddingExtractor * | p | ) |
Feed samples with SherpaOnnxOnlineStreamAcceptWaveform(), then call SherpaOnnxSpeakerEmbeddingExtractorIsReady() and SherpaOnnxSpeakerEmbeddingExtractorComputeEmbedding().
| p | A pointer returned by SherpaOnnxCreateSpeakerEmbeddingExtractor(). |
| void SherpaOnnxSpeakerEmbeddingExtractorDestroyEmbedding | ( | const float * | v | ) |
| v | A pointer returned by SherpaOnnxSpeakerEmbeddingExtractorComputeEmbedding(). |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxSpeakerEmbeddingExtractorDim | ( | const SherpaOnnxSpeakerEmbeddingExtractor * | p | ) |
| p | A pointer returned by SherpaOnnxCreateSpeakerEmbeddingExtractor(). |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxSpeakerEmbeddingExtractorIsReady | ( | const SherpaOnnxSpeakerEmbeddingExtractor * | p, |
| const SherpaOnnxOnlineStream * | s ) |
| p | A pointer returned by SherpaOnnxCreateSpeakerEmbeddingExtractor(). |
| s | A pointer returned by SherpaOnnxSpeakerEmbeddingExtractorCreateStream(). |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxSpeakerEmbeddingManagerAdd | ( | const SherpaOnnxSpeakerEmbeddingManager * | p, |
| const char * | name, | ||
| const float * | v ) |
| p | A pointer returned by SherpaOnnxCreateSpeakerEmbeddingManager(). |
| name | Speaker name. |
| v | Embedding vector with exactly dim elements. |
| int32_t SherpaOnnxSpeakerEmbeddingManagerAddList | ( | const SherpaOnnxSpeakerEmbeddingManager * | p, |
| const char * | name, | ||
| const float ** | v ) |
v is a NULL-terminated array of embedding pointers: v[0], v[1], ..., v[n - 1], followed by v[n] == NULL.
| p | A pointer returned by SherpaOnnxCreateSpeakerEmbeddingManager(). |
| name | Speaker name. |
| v | NULL-terminated array of embedding pointers. |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxSpeakerEmbeddingManagerAddListFlattened | ( | const SherpaOnnxSpeakerEmbeddingManager * | p, |
| const char * | name, | ||
| const float * | v, | ||
| int32_t | n ) |
The input contains n embeddings laid out consecutively, so the total array length must be n * dim.
| p | A pointer returned by SherpaOnnxCreateSpeakerEmbeddingManager(). |
| name | Speaker name. |
| v | Flattened embedding array. |
| n | Number of embeddings in v. |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxSpeakerEmbeddingManagerContains | ( | const SherpaOnnxSpeakerEmbeddingManager * | p, |
| const char * | name ) |
| p | A pointer returned by SherpaOnnxCreateSpeakerEmbeddingManager(). |
| name | Speaker name. |
References SHERPA_ONNX_API.
| void SherpaOnnxSpeakerEmbeddingManagerDestroyEmbedding | ( | const float * | v | ) |
| v | A pointer returned by SherpaOnnxSpeakerEmbeddingManagerGetEmbedding(). |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxSpeakerEmbeddingManagerDim | ( | const SherpaOnnxSpeakerEmbeddingManager * | p | ) |
| p | A pointer returned by SherpaOnnxCreateSpeakerEmbeddingManager(). |
References SHERPA_ONNX_API.
| void SherpaOnnxSpeakerEmbeddingManagerFreeAllSpeakers | ( | const char *const * | names | ) |
| names | A pointer returned by SherpaOnnxSpeakerEmbeddingManagerGetAllSpeakers(). |
References SHERPA_ONNX_API.
| void SherpaOnnxSpeakerEmbeddingManagerFreeBestMatches | ( | const SherpaOnnxSpeakerEmbeddingManagerBestMatchesResult * | r | ) |
| r | A pointer returned by SherpaOnnxSpeakerEmbeddingManagerGetBestMatches(). |
References SHERPA_ONNX_API.
| void SherpaOnnxSpeakerEmbeddingManagerFreeSearch | ( | const char * | name | ) |
| name | A pointer returned by SherpaOnnxSpeakerEmbeddingManagerSearch(). |
References SHERPA_ONNX_API.
| const char *const * SherpaOnnxSpeakerEmbeddingManagerGetAllSpeakers | ( | const SherpaOnnxSpeakerEmbeddingManager * | p | ) |
The returned array is NULL-terminated. If no speakers are enrolled, the returned array still exists and its first element is NULL.
| p | A pointer returned by SherpaOnnxCreateSpeakerEmbeddingManager(). |
| const SherpaOnnxSpeakerEmbeddingManagerBestMatchesResult * SherpaOnnxSpeakerEmbeddingManagerGetBestMatches | ( | const SherpaOnnxSpeakerEmbeddingManager * | p, |
| const float * | v, | ||
| float | threshold, | ||
| int32_t | n ) |
| p | A pointer returned by SherpaOnnxCreateSpeakerEmbeddingManager(). |
| v | Query embedding vector. |
| threshold | Minimum similarity threshold in the range [0, 1]. |
| n | Maximum number of matches to return. |
| const float * SherpaOnnxSpeakerEmbeddingManagerGetEmbedding | ( | const SherpaOnnxSpeakerEmbeddingManager * | p, |
| const char * | name ) |
The returned vector has SherpaOnnxSpeakerEmbeddingManagerDim(p) elements. Free it with SherpaOnnxSpeakerEmbeddingManagerDestroyEmbedding().
| p | A pointer returned by SherpaOnnxCreateSpeakerEmbeddingManager(). |
| name | Speaker name. |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxSpeakerEmbeddingManagerNumSpeakers | ( | const SherpaOnnxSpeakerEmbeddingManager * | p | ) |
| p | A pointer returned by SherpaOnnxCreateSpeakerEmbeddingManager(). |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxSpeakerEmbeddingManagerRemove | ( | const SherpaOnnxSpeakerEmbeddingManager * | p, |
| const char * | name ) |
| p | A pointer returned by SherpaOnnxCreateSpeakerEmbeddingManager(). |
| name | Speaker name to remove. |
References SHERPA_ONNX_API.
| const char * SherpaOnnxSpeakerEmbeddingManagerSearch | ( | const SherpaOnnxSpeakerEmbeddingManager * | p, |
| const float * | v, | ||
| float | threshold ) |
| p | A pointer returned by SherpaOnnxCreateSpeakerEmbeddingManager(). |
| v | Query embedding vector. |
| threshold | Minimum similarity threshold in the range [0, 1]. |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxSpeakerEmbeddingManagerVerify | ( | const SherpaOnnxSpeakerEmbeddingManager * | p, |
| const char * | name, | ||
| const float * | v, | ||
| float | threshold ) |
| p | A pointer returned by SherpaOnnxCreateSpeakerEmbeddingManager(). |
| name | Speaker name to compare against. |
| v | Query embedding vector. |
| threshold | Minimum similarity threshold in the range [0, 1]. |
References SHERPA_ONNX_API.
| const SherpaOnnxSpokenLanguageIdentificationResult * SherpaOnnxSpokenLanguageIdentificationCompute | ( | const SherpaOnnxSpokenLanguageIdentification * | slid, |
| const SherpaOnnxOfflineStream * | s ) |
Example:
| slid | A pointer returned by SherpaOnnxCreateSpokenLanguageIdentification(). |
| s | A pointer returned by SherpaOnnxSpokenLanguageIdentificationCreateOfflineStream(). |
| SherpaOnnxOfflineStream * SherpaOnnxSpokenLanguageIdentificationCreateOfflineStream | ( | const SherpaOnnxSpokenLanguageIdentification * | slid | ) |
Feed audio to the returned stream with SherpaOnnxAcceptWaveformOffline(), and then call SherpaOnnxSpokenLanguageIdentificationCompute().
| slid | A pointer returned by SherpaOnnxCreateSpokenLanguageIdentification(). |
| void SherpaOnnxVoiceActivityDetectorAcceptWaveform | ( | const SherpaOnnxVoiceActivityDetector * | p, |
| const float * | samples, | ||
| int32_t | n ) |
Input samples are mono floating-point PCM in the range [-1, 1].
| p | A pointer returned by SherpaOnnxCreateVoiceActivityDetector(). |
| samples | Pointer to n samples. |
| n | Number of samples. |
References SHERPA_ONNX_API.
| void SherpaOnnxVoiceActivityDetectorClear | ( | const SherpaOnnxVoiceActivityDetector * | p | ) |
| p | A pointer returned by SherpaOnnxCreateVoiceActivityDetector(). |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxVoiceActivityDetectorDetected | ( | const SherpaOnnxVoiceActivityDetector * | p | ) |
| p | A pointer returned by SherpaOnnxCreateVoiceActivityDetector(). |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxVoiceActivityDetectorEmpty | ( | const SherpaOnnxVoiceActivityDetector * | p | ) |
| p | A pointer returned by SherpaOnnxCreateVoiceActivityDetector(). |
| void SherpaOnnxVoiceActivityDetectorFlush | ( | const SherpaOnnxVoiceActivityDetector * | p | ) |
Call this after the last chunk of input has been fed.
| p | A pointer returned by SherpaOnnxCreateVoiceActivityDetector(). |
References SHERPA_ONNX_API.
| const SherpaOnnxSpeechSegment * SherpaOnnxVoiceActivityDetectorFront | ( | const SherpaOnnxVoiceActivityDetector * | p | ) |
The returned segment is a copy owned by the caller. Free it with SherpaOnnxDestroySpeechSegment().
| p | A pointer returned by SherpaOnnxCreateVoiceActivityDetector(). |
| void SherpaOnnxVoiceActivityDetectorPop | ( | const SherpaOnnxVoiceActivityDetector * | p | ) |
Call this after consuming the segment returned by SherpaOnnxVoiceActivityDetectorFront().
| p | A pointer returned by SherpaOnnxCreateVoiceActivityDetector(). |
References SHERPA_ONNX_API.
| void SherpaOnnxVoiceActivityDetectorReset | ( | const SherpaOnnxVoiceActivityDetector * | p | ) |
| p | A pointer returned by SherpaOnnxCreateVoiceActivityDetector(). |
References SHERPA_ONNX_API.
| int64_t SherpaOnnxWaveFileSize | ( | int32_t | n_samples | ) |
| n_samples | Number of PCM samples. |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxWriteWave | ( | const float * | samples, |
| int32_t | n, | ||
| int32_t | sample_rate, | ||
| const char * | filename ) |
| samples | Pointer to n samples in the range [-1, 1]. |
| n | Number of samples. |
| sample_rate | Sample rate in Hz. |
| filename | Output filename. |
References SHERPA_ONNX_API.
| int32_t SherpaOnnxWriteWaveMultiChannel | ( | const float *const * | samples, |
| int32_t | n, | ||
| int32_t | sample_rate, | ||
| int32_t | num_channels, | ||
| const char * | filename ) |
| samples | samples[c] is a pointer to channel c samples in [-1, 1]. |
| n | Number of samples per channel. |
| sample_rate | Sample rate in Hz. |
| num_channels | Number of channels. |
| filename | Output filename. |
References SHERPA_ONNX_API.
| void SherpaOnnxWriteWaveToBuffer | ( | const float * | samples, |
| int32_t | n, | ||
| int32_t | sample_rate, | ||
| char * | buffer ) |
Allocate at least SherpaOnnxWaveFileSize(n) bytes before calling.
| samples | Pointer to n samples in the range [-1, 1]. |
| n | Number of samples. |
| sample_rate | Sample rate in Hz. |
| buffer | Output buffer. |
References SHERPA_ONNX_API.