Change google assistant voice programmatically - actions-on-google

For most languages, the Google Assistant allows developers to choose from 4 type of voice as of now, 2 from female and 2 from male, for most languages.
I want to know the way to change it dynamically through node/java library.
I have tried with actions-on-google-nodejs but did not find anything in it.
I know we can change it either from google assistant application or from deployment setting, but do we have any way to change it dynamically?

Yes. Although not documented (except in StackOverflow currently) you can use the <voice> SSML tag to change which type is used. You can further adjust the pitch to create additional variants.
You can send SSML back using the actions-on-google-nodejs library by either including a string with valid SSML or by explicitly creating a SimpleResponse and setting the ssml property.
The multivocal library includes the ability to pre-define voices as combinations of the voice and prosody tags and will let you easily define which voice is to be used for each response.

Related

Is there a way to translate dynamic text in Play Framework?

I understand that the Play Framework (2.7) allows Internationalization in which to display pre-written text but is there a way that it can translate blocks of text dynamically? For example; suppose that a user has written a review and another user wants to read that review in their own language. It's not practical to manually translate user reviews before making them accessible to other users. Many thanks
Internationalization feature in Play has nothing in common with translation at all, it's just provide infrastructure around ability of you app to show content based on user localisation preferences. See https://www.playframework.com/documentation/2.8.x/ScalaI18N#Externalizing-messages:
You can externalize messages in the conf/messages.xxx files.
The default conf/messages file matches all languages. Additionally you can specify > language-specific message files such as conf/messages.fr or conf/messages.en-US.
Which means that you can have text files like
conf/messages.en-US:
example.message.id=Example message in US English
conf/messages.fr-FR:
example.message.id=Example message in French
and then retrieve particular message by it's id depending on languauge like:
val messagesApi: MessagesApi = //injected API
messagesApi("example.message.id")(lang)
So Play framework for you will choose proper file and read proper message for particular languague.
But content of files is your responsibility, Play does not translate nothing for you.

google actions sdk: dynamic change in voice

In the use case I am working on, I wish to change the TTS voice by passing a parameter in the conversation speech string. For example,
<speak><voice gender="male" variation="1">Hello</voice></speak>
The actions console mentions that we can override the user's default locale and force a particular TTS voice (as above). And it does work.
The question is: how do we set the voice to say: en-AU or en-GB via the voice tag? I tried setting it via variation or language or name, it does not work.
Thanks.
Although SSML supports a <voice> tag with a languages attribute, this isn't one of the SSML tags that are officially supported by the Google Assistant. Although there is evidence that the tag is semi-supported with the gender and variant attributes, the languages attribute isn't.
Aside from setting the region in the Action console, there is no way to currently change which region's voice is used for your Action.

Do keywords affect Bluemix Watson speech recognition?

Watson's speech recognizer supports a list of keywords as a parameter, but I'm trying to figure out whether these keywords actually affect recognition. For example, if you were handing Watson an audio clip you knew to contain proper names that might not be properly recognized, would submitting these names as keywords increase the likelihood that Watson would properly recognize them? Do the keywords interact with the recognition itself?
unfortunately the answer is no, the words wont get added to the vocabulary just because you added them as keywords, so they wont be found.
Dani
Looks like the answer to this is no (though I'd love to be proven wrong here): I ran a test clip that contained proper names that Watson mis-recognized, then submitted the same clip with those names as keywords, and it didn't change the transcript at all.
Not entirely conclusive, but it seems like the answer is no.

Name input like SMS or Facebook app

I'm trying to find a library that can handle autocompletion with tokened (grouped) texts.
There are some very nice libraries out there for autocompletion such as:
https://github.com/EddyBorja/MLPAutoCompleteTextField
https://github.com/hoteltonight/HTAutocompleteTextField
https://github.com/TarasRoshko/TRAutocompleteView
The problem here is, I want to make the selection look like names tagging at SMS or Facebook app. So when the user tries to delete, he should delete all the text.
There are good jQuery implementations, one of them is this:
http://loopj.com/jquery-tokeninput/
I couldn't find any for iOS, perhaps the keywords are very generic, thus Google does not show any related results. Is there any library for this or can you provide any code examples?
What you're trying to achieve can't be done using the public SDK.
However, there exist some nice third party solutions.
I found this question, Is there an iPhone equivalent to the NSTokenField control?, which includes links to controls you could use.

Speech to text in multiple languages

i have success fully implemented the ispeech API see http://www.ispeech.org/developers for my app to convert speech to text(see the demo app in the sdk http://www.ispeech.org/instructions/sampleprojects/iphone/IntegrationGuide.html). But unfortunately it takes what we speak as only in english and translte it to text.
what i need.
There is a "speak" button that listens what the user spokes and convert it to text(that works fine for english). Also another button that allows the user to select a language as seen in this appscreenshot( http://screencast.com/t/7vBFH565qD). So when the user speaks in the selected language it should get converted to the same language. In my case whatever we speak it takes the input only in english..
Thanks all..
iSpeech also supports more languages, you can find the list with their corresponding locale identifiers here:
http://www.ispeech.org/api
To set a new language you have the "ISpeechSetLocale" method
[_iSpeech ISpeechSetLocale:#"fr-FR"];
http://www.ispeech.org/developer/iframe?src=/iphonesdkdoc/
Why cant you use the NUANCE API which supports speech to text in multiple languages. see the following link and register there to use their iOS sdk .
http://dragonmobile.nuancemobiledeveloper.com/public/index.php?task=supportedLanguages