Giter VIP home page Giter VIP logo

cordova-plugin-speech's People

Contributors

pravinkumarputta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cordova-plugin-speech's Issues

NSSpeechRecognitionUsageDescription didn't ask for the permission.

Hi Pravin,

I have implemented the Speech framework in my Cordova App and it didn't ask the NSSpeechRecognitionUsageDescription permission on iOS real device also the speechRecognizer variable comes nil because of an optional:
@objc(startRecognition:) // Declare your function name. func startRecognition(command: CDVInvokedUrlCommand) { if !self.**speechRecognizer!**.isAvailable { self.publishSTTError(error: "Speech recognition service not available") return }

PS: I am using Xcode 13.2.

Could anyone can help me out for the above mentioned query?

Thanks in advance!

Unfinished speakOut() will be interrupt by another call and never gets the 'tts-end' callback

I fixed it by replacing Line 46
let language = options && options.language ? options.language : 'en-US' // Line 46
with the following codes

    if (typeof Speech.__currentSpeakOutSuccess == 'function') {
        success('tts-end')
        return
    }
    Speech.__currentSpeakOutSuccess = onMessage
    exec(onMessage, error, SPEECH, API_LIST.SPEAK_OUT, [message, pitchRate, speechRate, language])

    function onMessage (msg) {
        if (msg == 'tts-end') delete Speech.__currentSpeakOutSuccess
        success(msg)
    }

Android: forcing offline speech recognition is deprecated and fails

https://github.com/pravinkumarputta/cordova-plugin-speech/blob/master/src/android/com/pravinkumarp/Speech.java#L388

While this doesn't seem officialy documented as of now, from my testing on Android 10 and above devices when using

recognizerIntent.putExtra(RecognizerIntent.EXTRA_PREFER_OFFLINE, true);

I get the following error log : Error parsing intent: EXTRA_PREFER_OFFLINE parameter is deprecated and speech recognition fails immediatly returning SpeechRecognizer.ERROR_NO_MATCH.

Note that offline speech recognition appears to work fine when not using EXTRA_PREFER_OFFLINE.

Ability to stop current speakOut() words

Is it possible to halt currently-speaking words?

Perhaps calling speakOut() again before TTS has ended would cut off current speech, or...

  • call speakOut("") to stop current,
  • "replaceActive" parameter on options,
  • speakStop() method, etc?

Thanks!

language option does not work since it is not passed to Swift/Java codes

I found the language property is not passed to the native codes. I fixed it with the following changes.

Speech.js

    let language = options && options.language ? options.language : 'en-US' // Line 45
    exec(success, error, SPEECH, API_LIST.SPEAK_OUT, [message, pitchRate, speechRate, language]) // Line 46

Speech.swift

        var language = command.arguments[3] as? String ?? "en-US"  // Line 92
        speechUtterance.voice = AVSpeechSynthesisVoice(language: language) / Line 99

Speech.java

                Speech.this.speak(message, pitchRate, speechRate, language);  // Line 179

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.