๐จโ๐ป All of my projects are available at Enkodo
๐ฌ Ask me about angular, sql, node
๐ซ How to reach me sebastiaan[@]enkodo.nl
๐ Know about my experience on codersrank
๐จโ๐ป All of my projects are available at Enkodo
๐ฌ Ask me about angular, sql, node
๐ซ How to reach me sebastiaan[@]enkodo.nl
๐ Know about my experience on codersrank
If I call TTS.getVoices().then( function(x) { alert(JSON.stringify(x)); } );
, I get some unexpected stuff:
Aside: what is the purpose of this function? I was hoping to get something back I could use to call speak() with an explicit voice specified. It's not documented in the README, so maybe I just shouldn't be calling it! ;)
Category has been removed from TTS.IOptions in commit fafba8c.
Why is this change?
The category option is a flag required to mute TTS when the mute mode is turned on on the iPhone.
NSString* category = [options objectForKey:@"category"];
[[AVAudioSession sharedInstance] setActive:NO withOptions:0 error:nil];
if ([category isEqualToString:@"ambient"]) {
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient
withOptions:0 error:nil];
} else {
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback
withOptions:AVAudioSessionCategoryOptionDuckOthers error:nil];
}
Thank you,
Due to a dumb bug on my end, I was passing "identifier: 1" to this plugin (numeric value, not string), and this causes the app to crash on iOS.
In case this is at all useful, I tested other (potentially dumb) inputs:
When I try to install the plugin using the command: cordova plugin add cordova-plugin-tts-2
It gives an error:
npm ERR! 404 'cordova-plugin-tts-2' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
However, the following command works: npm i cordova-plugin-tts-advanced
Hi there,
I made a button called: Install voices, which when clicked on android goes to the correct page to select a voice.
However, this button gives the following errors when clicked on iOS:
To Native Cordova -> TTS openInstallTts TTS1400231065 ["options": []]
Error: Plugin CDVTTS does not respond to method call openInstallTts:.
Ensure plugin method exists and uses @objc in its declaration
I need this working on iOS since the only voice a user can at this point select is the default Xander voice (dutch). This means that the user needs to have the option to install other dutch voices in their phone.
Looking at the native Objective C code, this method does not seem to exist yet for iOS.
I'm going to try and find out how I can open this specific settings page in iOS native and see if I can help make this functionality for the plugin since I need it for our next version of our app.
I have little to no experience in Objective C so I made a stackoverflow post here:
https://stackoverflow.com/questions/66919691/how-can-i-open-the-install-voices-settings-page-in-objective-c-ios
Hey,
apparently when I do:
TTS.stop().then(() => {
this.isTalking = false;
console.log('stopped');
}).catch((reason: any) => {
this.isTalking = false;
console.log(reason);
});
The then and catch are not being called...
The stop is being called though, so I think I'lll just remove the .then and set it to false after calling stop.
It is nice to have a callback to know whether it stopped or errored out for some reason though.
Dear spasma,
I would like to use your plugin since it supports voice.
However, I'm unable to figure out which typescript plugin to import because I can't seem to find any type declarations other than in the readme.
Are we supposed to add this typescript ourselves somewhere?
I would like to use this inside of ionic, ionic-native has wrapper typescript for the cordova-plugin-tts.
But this is not available for cordova-plugin-tts-advanced...
I'll go ahead and try to create a index.d.ts file and make a pull request, see if that works...
If you would also like to help me out on this issue I would very much appreciate it.
As it says, then() is not called after successful speak() on Android 7.0 (what I tested with). It works on iOS.
I get the impression that the bug is generated once the voice package is downloaded and cached. I have tested in 3 mobile phones: Samsung A21, Oppo reno7, and a Motorola. Pitch changes only works on Android studio Emulator.
Is there are any solution for this?
You can try using this plugin for a couple of minutes then turn off your mobile, turn on and then the bug will occur
Hey,
I'm trying to implement an ion-select where the user is able to select which voice they want to use inside of the app.
However, both the name and identifier of a voice is the same in android. Normally you would see voice 1 or voice 2 on android as name of the voice when you look in the settings for switching voices. But this is returning the same data as the identifier.
This way users will have a hard time figuring out which voice is which, because these strings look quite tedious instead of having an actual name for the voice.
There is also no "default" property for the voices. This way I'm unable to set the ion-select to the default value of the device.
I haven't tested this on iOS yet.
EDIT: I just tested this on iOS, and there it does seem to show a correct name, but still not a default property.
On the other devices it works, but on samsung the voice is very slow, I don't know if it is because maybe it uses Samsung TTS and not Google TTS.
On iOS, voice selection works OK when I include a valid "identifier" from getVoices(), e.g.
TTS.speak({
text:"sample text", cancel:true, pitch:1, locale:"en-IN", identifier:"com.apple.ttsbundle.Rishi-compact"
}).then(...); // en-IN voice heard, as expected.
But when I call speak() with locale only (no identifier), it seems it uses the system language always, regardless of which locale I specify.
TTS.speak({
text:"sample text", cancel:true, pitch:1, locale:"en-IN"
}).then(...); // System/default voice is heard, not en-IN voice.
Looking over logic in CDVTTS.m, seems this might not be by design.
Hey, I don't know if anyone is still looking at this but I am having issues with the cancel argument. From what I understand, if cancel is set to true then the text argument will interrupt any other text that is currently being spoken. What I have found is that this doesn't happen consistently. Right now I have some code to speak a number every time it changes until they get to a goal number.
Every time the number changes this is run where pickedNumber is the new number:
TTS.speak({text: pickedNumber+' ', rate: listSpeeds.selectionData[0].TTSRate, cancel: true});
Every time the pickedNumber reaches the goal number this is run:
TTS.speak({text: "Complete", rate: TTSRate, cancel: true});
What I have found is that the pickedNumber text does interrupt other text statements, but the "Complete" text does not interrupt the pickedNumber text. I have tried initializing the pickedNumber variable as a string, setting PickedNumber to a number+" ", using the String(pickedNumber) in the text argument, have the text argument be " "+pickedNumber+" ", and have another speak with a text: " " to try to interrupt. Nothing has made "Complete" consistently interrupt the pickedNumber.
If anyone has any insight to this or any tips, let me know. Thank you.
After I upgraded my Samsung A41 from Android 11 to 12 many languages produces ERR_UNKNOWN
when using TTS.speak function. I used to be able to listen to e.g. with Spanish, Chinese, Dutch, German.
Some still do work, e.g. French, Arabic, English, Portuguese.
I have no clue why some work and some do not anymore.
I am trying to fetch all the supported voices using the code provided below:
this.platform.ready().then((source) => {
this.tts.getVoices().then(voices => {
console.log(voices);
}, error => {
console.log(error);
});
});
I am just not getting anything. Any help is greatly appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.