Open sumanbogati opened 7 years ago
@sumanbogati Could you please show me the error logs so that I can look at errors ?
When I am alerting the error, it would come something like below
Hi Mihir,
Have you found something related to this error ?
I would really appreciate if you give me the working example of text-to-speech.
Thank you.
I am also trying to get this to work but having no luck.
What's odd is that if I output tts
to the console, it says it's an object with five functions (speak, stop, shutDown, etc.). But if I try to use tts.speak()
I get Cannot read property 'speak' of undefined
. The console says tts
is defined but it suddenly becomes undefined if I try to use it.
function buttonClicked () {
var tts = require('react-native-android-speech')
console.log("tts = ", tts);
tts.speak({text:'Please provide some text to speak.'});
}
I think I am running into the same Problem. However it looks as if the tts import from the package works, but the AndroidTTS object is not able to send the speak message.
ReactNativeJS: { [TypeError: undefined is not an object (evaluating 'AndroidTTS.speak')] ReactNativeJS: line: 82144, ReactNativeJS: column: 11, ReactNativeJS: sourceURL: 'http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false' }
@scepticulous Do you have sample repo where I can reproduce this ?
Hi @mihirsoni, here is an minimal example app that causes the error.
I get same issue too. Whatever function I use (isSpeaking, isSpeak, getLocales), I got error "Cannot read property 'isSpeaking' of undefined"
, "Cannot read property 'isSpeak' of undefined"
, "Cannot read property 'getLocale' of undefined"
. Still figure out the solution
I can successfully built your project, however the text-to-speech is not working, I can't hear the audio after clicked on "button" text, the apk file is installed in android phone. Here is my index.android.js
` import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View, Platform, TouchableHighlight, TouchableNativeFeedback } from 'react-native';
` Can you please tell me why this is not working ? I have downloaded your code before one month and since then I have been working on this.