UNPKG

react-native-voice2text

Version:

React Native module for Android that converts speech to text using native speech recognition

36 lines 1.41 kB
export interface SpeechResultsEvent { text: string; alternatives: string[]; } export interface SpeechErrorEvent { message: string; code: number; } export interface SpeechEndEvent { ended: boolean; } export interface VolumeChangedEvent { rmsdB: number; } export type SpeechResultsCallback = (results: SpeechResultsEvent) => void; export type SpeechErrorCallback = (error: SpeechErrorEvent) => void; export type SpeechEndCallback = (event: SpeechEndEvent) => void; export type VolumeChangedCallback = (event: VolumeChangedEvent) => void; export type SimpleEventCallback = () => void; declare const Voice2TextModule: { checkPermissions(): Promise<boolean>; requestPermissions(): Promise<boolean>; startListening(languageCode?: string | null): Promise<boolean>; stopListening(): Promise<boolean>; cancelListening(): Promise<boolean>; destroy(): Promise<boolean>; onResults(callback: SpeechResultsCallback): () => void; onPartialResults(callback: SpeechResultsCallback): () => void; onError(callback: SpeechErrorCallback): () => void; onSpeechStart(callback: SimpleEventCallback): () => void; onSpeechBegin(callback: SimpleEventCallback): () => void; onSpeechEnd(callback: SpeechEndCallback): () => void; onVolumeChanged(callback: VolumeChangedCallback): () => void; }; export default Voice2TextModule; //# sourceMappingURL=index.d.ts.map