Voice to Text

try selecting “copy to device and launch”

and then post corona terminal out when getting error

Screen%20Shot%202017-02-21%20at%208.40.5

Ok, I’m not on the computer right now, just as I run the test and send the log.

But I would still like to know if it is possible to increase the time for the e.response == “stopped” event, or even leave it as non-iOS works, click a text / button to fire the voiceToText.stopRecording ()

I pushed an update a couple yesterday that fixes a few things on android and adds more options for length of speech for android. i just update the docs, please look under startRecoding.

Perfect, that’s it!

The PublisherId issue now also worked (tech.scotth)

Thanks.

Good morning

I’m trying again plugin VOICE TO TEXT

I can not get it running on samsung galaxy S6 (6.0.1) 

Instead on samsung galaxy ace 4 (4.4.4) works

Not from any mistake, it seems as if it can not access the phone’s microphone.

You know how to help me

thank you so much

have you checked out the code in this example https://github.com/scottrules44/voiceToText-Demo

you need to request access

local function appPermissionsListener( event ) for k,v in pairs( event.grantedAppPermissions ) do if ( v == "Microphone" ) then microphoneAccess = true print( "Microphone permission granted!" ) end end if microphoneAccess == false then print( "Microphone permission not granted" ) end end function showPermissionPopup( ) local options = { appPermission = "Microphone", urgency = "Critical", listener = appPermissionsListener, rationaleTitle = "Microphone access required", rationaleDescription = "Microphone access is required to take photos. Re-request now?", settingsRedirectTitle = "Alert", settingsRedirectDescription = "Without the ability to use microphone, this app cannot properly function. Please grant microphone access within Settings." } native.showPopup( "requestAppPermission", options ) end showPermissionPopup( )

Hi Scott,

I’m from Indonesia and I want to use indonesian language (bahasa indonesia) as default language on my android apps. I’ve tried to set language using “id_ID” in :

 

voiceToText.startRecording(“id_ID”)

but seems it doesn’t work and my apps keep using english as default language, I even have tried to change the code using “id-ID” “in-ID” “in_ID”, but my apps still translate my voice using english. There are no errors on my log.

Is it because I use wrong language code for bahasa indonesia or anything else I should set in my codes?

I use corona Version 2017.3033 (2017.2.9).

Thanks.

Have you tried “id” ?

Yes, I’ve tried using “id” and "ID, but unfortunately both are still failed and the apps still detect my voice using english language.

This should be fixed, use “id-ID”

Wow fantastic!! It works like a charm!!! Thank you very much for your quick response and solution.

Thanks.

Hi Scott,

Please can you help. I’ve been using the plugin now for about a month after I purchased it from the market store and managed to get everything working great. Its a wonderful plugin however its stopped working today. I’ve gone through the code in my app with a fine brush to make sure there are no problems there but could find none. To make sure I also tested the voiceToText demo app on an android device. Both my app and the demo came back with the same runtime error:

java.lang.illegalArgumentException:illegal index

This runtime error appears when calling;

 voiceToText.startRecording();

Please could you check things on your side of things as I think there may be error or something has changed that has stopped the plugin from working properly when a function call is made to start recording. Sincerest apologise if I’m wrong but I’ve exhausted all possible reason on this side of things. I’ve checked both the device is working properly with wifi working fine and also all the code related to the plugin and not related to the plugin in the app is working fine. Thank you for your help.

Kind Regards

Liam

Can you post the full error please?

Hi Scott,

That mainly all there is, however the above error message is for an app in release mode in debug mode it comes back with:

/user/liamyoung/Desktop/Mirror/Smart Mirror/SCENES/menuScene.lua:1012:java.lang.illegalArgumentException:illegal index

Here the code at 1012 in menu scene:

   1006        if(voiceToText.isRecording())then    1007              voiceToText.stopRecording();    1008              recordingMic.alpha = 0;     1009              timers.voiceCount = timers.voiceMax - 60;    1010             return;    1011        end    1012        voiceToText.startRecording(); -- place of Runtime Error    1013        recordingMic.alpha = 1;      1014        timers.voiceCount = 0;

It was from these results I then check if the voice to text demo was working okay. Again it came back with the same error but relevant to where the call to voiceToText.startRecording() is in the app. If i remove the call to the voiceToText.startRecording() there no Runtime error so its definitely seems a problem with the function for some reason. Unfortunately though this is all I have to go on sorry Scott.

Kind Regards

Liam

Try rebuilding now.

Hi Scott,

Apologise for the delay in getting back to you. Just done a rebuild and its working perfectly again  :slight_smile: .

Thanks Scott

Kind Regards

Liam

Hi, I want to use inputSilenceLength(2000) on android

In your example where does it go? I’m getting this when I insert into voiceToText.init(function(e)

—  main:45: attempt to call global ‘inputSilenceLength’ (a nil value)

it would be like this

voiceToText.startRecording(nil, nil, 2000)

I’m finding that this has no effect - voiceToText.startRecording(nil, nil, 5000,5000,5000)

Recording stops 2.2 seconds after start. I’m recording “1,2”, so a very short recording session.

When I record a longer session, still stops immediately on a pause.

This is on 2 phones Android 4.4.4 and 6.

Could you please upload a zipped up sample project which clearly demonstrates the issue?