@hgy29 Would it be possible to post the NDK project here (zip file) so I can use it to recreate the plugin on my PC. I'd like to start implementing some new features too, now that we also have the iOS version.
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!). https://deluxepixel.com
Hi @hgy29 I understand the need to add this to the repo, but how do I compile the tts plugin without having to download the complete Gideros repo? What is the project structure on a local PC just for the tts plugin?
To build it, just grab the entire tts folder, modify the first two lines of the Makefile so that they point to the Sdk folder of your gideros installation and to the ndk-build script from android NDK installation.
Then navigate to the tts folder from a command line and launch make. The resulting plugin files should end up in Build/tts subfolder.
I downloaded the android-ndk-r14b SDK and updated the Makefile as to your instructions in your previous post. Gideros 2017.04.1 is installed in the default location so I did not change it.
I was unsure wether you were using Windows or Mac. On Mac make tool is preinstalled, but on Windows you need to install a Unix like shell with a few build tools.
I use MSYS2 for this purpose, and I recommand to use it, you can get it here https://msys2.github.io/
Once installed, open a MSYS2 terminal (msys2_shell.cmd) then finish your MSYS2 setup with the following commands: pacman –Sy pacman pacman –Syu pacman –Su pacman –S tar wget pacman –S zip unzip pacman –S git pacman –S base-devel
after those, navigate to your tts folder (cd /drive/xxx/tts) then just type 'make'
@hgy29 I followed your instructions in your previous post, and all seemed to work fine. I'll need to do some dev work on tts and test it on a device to be sure!!
Thanks again for all your help. I wouldn't have been able to do this without your guidance.
Simon PS- Does this make me an official maintainer? LOL
@simwhi, I am glad it worked for you indeed! With this simple setup you could even start building some gideros parts from source! If you want to contribute to the source code, it would be best to start by forking gideros project on github, learn to use git (I use gitbash to deal with git) to checkout your repository and commit back your changes, then ask for pull requests to gideros official repository once your happy with your changes and wish to share them.
Oh, and I wanted to explain a few things about the plugin structure: - in root directory you have the .gplugin file, which tells gideros what should be done to integrate your plugin into final project when it is ticked in plugin selection pane. - in source/common, the .cpp file is the plugin entry point from gideros point of view, its purpose is to register the plugin into lua and translate lua calls into C style calls defined in the .h file sitting alongside - in source/Android, you will find the android implementation of the C calls, which again translate C calls to Java/JNI When adding iOS support, we would add a source/iOS folder with a .m file containing the iOS implementation of the same C calls.
Here is a stable version of the TTS plugin for iOS, fixing some major bugs following real world testing.
I have tried and tried to split the code into 3 files to fit the new Gideros plugin structure but have really struggled as my Objective C skills are a bit weak. The templates I followed use a single .mm file structure. So unless I figure it out or someone can help, in the meantime just adding this file to the plugin folder in XCode will work. It is dependent on the AVFoundation framework, which is already exported by Gideros.
Hi guys! I see that "text-to-speech" functionality is available.
I wanted to ask - is it possible to implement "speech-to-text" in my project? (user says a word, app checks if it matches text)
> Newcomers roadmap: from where to start learning Gideros "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
> Newcomers roadmap: from where to start learning Gideros "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
I've just finished doing some bug fixes for our main game and I noticed that the current Java source code for the TTS plugin is slightly out of date. I've also added a NULL test in the setLanguage() method as there were crash reports.
> Newcomers roadmap: from where to start learning Gideros "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
Hi guys! I'm testing TTS plugin on Android, can you pls help with few questions?
1) By default there's female voice, how to switch to male? Or choose between different types of voices?
for iOS there's code snippet:
if count ==5and platform =="iOS"then
tts:setVoiceIdentifier("com.apple.ttsbundle.siri_female_en-GB_premium")end
Are there similar calls for Android?
2) And what does second parameter ("utterance") do?
tts:speak("Hi guys","hello")
I don't see any changes if I change parameter "hello" to any other word.
3) There's significant delay when we play text string first time (it has to be downloaded from google's translation servers?) Is there a way to pre-cache it? I'm thinking about 'setVolume(0)' and playing text strings silently in advance.
> Newcomers roadmap: from where to start learning Gideros "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
1) It isn't possible to change the voice in code in the current Android TTS plugin. However, I did hack my version of the TTS so this can be done (via setLanguage method). It's not pretty, so I don't want to release it here. It should be done correctly, but I do not know how to create new methods and callbacks for Gideros plugins. The iOS version supports changing voices in code.
2) The speak method queues each char sequence (words to be spoken). The utterance parameter is used to tag each char sequence. After the the sequence has been spoken eventTtsUtterance is called passing the utterance parameter.
3) The TTS engine can take some time to initialise for the first time. We do this when our app loads. Nothing is downloaded or translated as the voices and engine work locally. We suggest that you use the free Google TTS engine as they have the best voices. You can also download more enhanced voices (free) from within the TTS engine settings.
Most devices have google TTS but Samsung have there own TTS engine set by default. The Samsung TTS engine is terrible.
Comments
https://github.com/gideros/gideros
https://deluxepixel.com
Likes: pie
Likes: SinisterSoft, vitalitymobile
To build it, just grab the entire tts folder, modify the first two lines of the Makefile so that they point to the Sdk folder of your gideros installation and to the ndk-build script from android NDK installation.
Then navigate to the tts folder from a command line and launch make.
The resulting plugin files should end up in Build/tts subfolder.
I downloaded the android-ndk-r14b SDK and updated the Makefile as to your instructions in your previous post. Gideros 2017.04.1 is installed in the default location so I did not change it.
Here are the first 2 lines:
Forgive my ignorance, but how to I execute the Makefile?
I use MSYS2 for this purpose, and I recommand to use it, you can get it here https://msys2.github.io/
Once installed, open a MSYS2 terminal (msys2_shell.cmd) then finish your MSYS2 setup with the following commands:
pacman –Sy pacman
pacman –Syu
pacman –Su
pacman –S tar wget
pacman –S zip unzip
pacman –S git
pacman –S base-devel
after those, navigate to your tts folder (cd /drive/xxx/tts) then just type 'make'
Thanks again for all your help. I wouldn't have been able to do this without your guidance.
Simon
PS- Does this make me an official maintainer? LOL
Likes: hgy29
With this simple setup you could even start building some gideros parts from source!
If you want to contribute to the source code, it would be best to start by forking gideros project on github, learn to use git (I use gitbash to deal with git) to checkout your repository and commit back your changes, then ask for pull requests to gideros official repository once your happy with your changes and wish to share them.
- in root directory you have the .gplugin file, which tells gideros what should be done to integrate your plugin into final project when it is ticked in plugin selection pane.
- in source/common, the .cpp file is the plugin entry point from gideros point of view, its purpose is to register the plugin into lua and translate lua calls into C style calls defined in the .h file sitting alongside
- in source/Android, you will find the android implementation of the C calls, which again translate C calls to Java/JNI
When adding iOS support, we would add a source/iOS folder with a .m file containing the iOS implementation of the same C calls.
I have tried and tried to split the code into 3 files to fit the new Gideros plugin structure but have really struggled as my Objective C skills are a bit weak. The templates I followed use a single .mm file structure. So unless I figure it out or someone can help, in the meantime just adding this file to the plugin folder in XCode will work. It is dependent on the AVFoundation framework, which is already exported by Gideros.
Likes: antix, SinisterSoft
Likes: NatWobble, SinisterSoft
I wanted to ask - is it possible to implement "speech-to-text" in my project?
(user says a word, app checks if it matches text)
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
I see there's some API on Android: https://developer.android.com/reference/android/speech/SpeechRecognizer.html
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
I have already written a demo Android app for speech to text, but I haven't got it working with Gideros yet.
Likes: antix, Apollo14
I've just finished doing some bug fixes for our main game and I noticed that the current Java source code for the TTS plugin is slightly out of date. I've also added a NULL test in the setLanguage() method as there were crash reports.
Likes: Apollo14
speech-to-text plugin for Gideros could be an awesome addition!
Likes: antix, Atavismus
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
I'm testing TTS plugin on Android, can you pls help with few questions?
1) By default there's female voice, how to switch to male? Or choose between different types of voices?
for iOS there's code snippet:
2) And what does second parameter ("utterance") do?
3) There's significant delay when we play text string first time (it has to be downloaded from google's translation servers?)
Is there a way to pre-cache it?
I'm thinking about 'setVolume(0)' and playing text strings silently in advance.
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
1) It isn't possible to change the voice in code in the current Android TTS plugin. However, I did hack my version of the TTS so this can be done (via setLanguage method). It's not pretty, so I don't want to release it here. It should be done correctly, but I do not know how to create new methods and callbacks for Gideros plugins. The iOS version supports changing voices in code.
2) The speak method queues each char sequence (words to be spoken). The utterance parameter is used to tag each char sequence. After the the sequence has been spoken eventTtsUtterance is called passing the utterance parameter.
3) The TTS engine can take some time to initialise for the first time. We do this when our app loads. Nothing is downloaded or translated as the voices and engine work locally. We suggest that you use the free Google TTS engine as they have the best voices. You can also download more enhanced voices (free) from within the TTS engine settings.
Most devices have google TTS but Samsung have there own TTS engine set by default. The Samsung TTS engine is terrible.
Likes: Apollo14, MoKaLux