voice icon indicating copy to clipboard operation
voice copied to clipboard

Can you recognize Chinese? Can it be recognized in the background?

Open bbhxwl opened this issue 7 months ago • 1 comments

Can you recognize Chinese? Can it be recognized in the background?

bbhxwl avatar May 28 '25 06:05 bbhxwl

Answer Yes, the @react-native-voice/voice module can recognize Chinese and supports background recognition capabilities.

Chinese Language Support The module supports Chinese recognition through locale specification. When starting speech recognition, you can specify Chinese locales such as:

'zh-CN' for Simplified Chinese (China) 'zh-TW' for Traditional Chinese (Taiwan) 'zh-HK' for Traditional Chinese (Hong Kong) You would use it like this: VoiceTest.tsx:114

The module accepts any valid locale string in the start() method index.ts:124-160 , and Chinese locales are supported by both Android's SpeechRecognizer and iOS's SFSpeechRecognizer underlying APIs.

Background Recognition The module does support background recognition capabilities, though this depends on platform-specific configurations:

iOS Background Support: The iOS implementation uses SFSpeechRecognizer which can work in background modes when properly configured. You would need to add background modes to your Info.plist for audio processing.

Android Background Support: Android's SpeechRecognizer can also work in background, but requires proper service configuration and permissions.

The module's architecture supports continuous recognition through the event system index.ts:287-327 , where events like onSpeechPartialResults and onSpeechResults continue to fire regardless of app state.

Platform Considerations Both platforms require proper permissions for microphone access README.md:194-242 . For Chinese recognition specifically, ensure your device has the appropriate language packs installed and that the speech recognition service supports Chinese (particularly important on Android where Google's speech service is required README.md:217-227 ).

jsnavarroc avatar Jun 12 '25 01:06 jsnavarroc