Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Punctuation is not respected on Android #46

Open
Jankaz2 opened this issue Oct 27, 2024 · 1 comment
Open

Punctuation is not respected on Android #46

Jankaz2 opened this issue Oct 27, 2024 · 1 comment

Comments

@Jankaz2
Copy link

Jankaz2 commented Oct 27, 2024

As title says, punctuation is not respected on android devices no matter what Android device and version I use.
Android's docs say that Depending on the recognizer implementation, this value may have no effect. but actually I cannot find any device on which this works. However on iOS it works perfect.

Even the demo video in README.md shows that punctuation is not respected on Android device.

Maybe you know some workarounds or fixes?

My settings are like following

    const [settings, _] = useState<ExpoSpeechRecognitionOptions>({
        lang: languageToCode(lang! as Language) ?? 'en-NZ',
        interimResults: true,
        maxAlternatives: 3,
        continuous: true,
        requiresOnDeviceRecognition: false,
        addsPunctuation: true,
        androidIntentOptions: {
            EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS: 10000,
            EXTRA_HIDE_PARTIAL_TRAILING_PUNCTUATION: true
        },
    });
@jamsch
Copy link
Owner

jamsch commented Oct 28, 2024

Hey @Jankaz2, the punctuation feature for Android seems to only be supported on Android 13+ with on-device recognition enabled (i.e. using the com.google.android.as package or enabling requiresOnDeviceRecognition)

There's a few options you can do, including:

Here's a test on an Android 14 device with on-device speech recognition enabled:

Screen_Recording_20241028_130421_expo-speech-recognition-example.mp4
Screen_Recording_20241028_130700_expo-speech-recognition-example.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants