Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Voice to Text
Started by Scott Harrison Oct 17 2016 09:45 AM

106 replies to this topic
[TOPIC CONTROLS]
Page 3 of 5 1 2 3 4 5
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#51

andri.yunanto

[GLOBAL: userInfoPane.html]
andri.yunanto
  • Observer

  • 4 posts
  • Corona SDK

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.



[TOPIC: post.html]
#52

zombieboffinstudioltd

[GLOBAL: userInfoPane.html]
zombieboffinstudioltd
  • Enthusiast

  • 39 posts
  • Corona SDK

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



[TOPIC: post.html]
#53

Scott Harrison

[GLOBAL: userInfoPane.html]
Scott Harrison
  • Corona Geek

  • 1,795 posts
  • Enterprise

Can you post the full error please?

[TOPIC: post.html]
#54

zombieboffinstudioltd

[GLOBAL: userInfoPane.html]
zombieboffinstudioltd
  • Enthusiast

  • 39 posts
  • Corona SDK

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



[TOPIC: post.html]
#55

Scott Harrison

[GLOBAL: userInfoPane.html]
Scott Harrison
  • Corona Geek

  • 1,795 posts
  • Enterprise

Try rebuilding now.

[TOPIC: post.html]
#56

zombieboffinstudioltd

[GLOBAL: userInfoPane.html]
zombieboffinstudioltd
  • Enthusiast

  • 39 posts
  • Corona SDK

Hi Scott,

 

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

 

Thanks Scott

 

Kind Regards

 

Liam



[TOPIC: post.html]
#57

conor1

[GLOBAL: userInfoPane.html]
conor1
  • Contributor

  • 166 posts
  • Corona SDK

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)



[TOPIC: post.html]
#58

Scott Harrison

[GLOBAL: userInfoPane.html]
Scott Harrison
  • Corona Geek

  • 1,795 posts
  • Enterprise

it would be like this

voiceToText.startRecording(nil, nil, 2000)


[TOPIC: post.html]
#59

conor1

[GLOBAL: userInfoPane.html]
conor1
  • Contributor

  • 166 posts
  • Corona SDK

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.



[TOPIC: post.html]
#60

Scott Harrison

[GLOBAL: userInfoPane.html]
Scott Harrison
  • Corona Geek

  • 1,795 posts
  • Enterprise

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



[TOPIC: post.html]
#61

conor1

[GLOBAL: userInfoPane.html]
conor1
  • Contributor

  • 166 posts
  • Corona SDK

Essentially it's your demo with minor text display adjustment plus the offending voiceToText.startRecording(nil, nil, 5000,5000,5000)

Attached Files



[TOPIC: post.html]
#62

conor1

[GLOBAL: userInfoPane.html]
conor1
  • Contributor

  • 166 posts
  • Corona SDK

Update. It seems that the timeout is delayed if the voice recognition needs time to work out what is said. I spoke gibberish into the app, paused and spoke proper words. Because  my gibberish was still being processed, the pause was 'accepted' and my proper words after the pause also accepted.

Probably not be of any use of course...



[TOPIC: post.html]
#63

Scott Harrison

[GLOBAL: userInfoPane.html]
Scott Harrison
  • Corona Geek

  • 1,795 posts
  • Enterprise

It looks like Google either removed this feature to set inputSilenceLength or it is a bug. Either way, it looks like it is not working for anyone.

I have also tried a couple apps that use this android api and they seem to have the same issue. I can not do anything on my end to fix this google issue. 

 

Sources:

https://stackoverflow.com/a/28628826

https://stackoverflow.com/a/17675098



[TOPIC: post.html]
#64

conor1

[GLOBAL: userInfoPane.html]
conor1
  • Contributor

  • 166 posts
  • Corona SDK

A subnote to this issue. I was testing again with some music playing in the background, and the recording continued for longer than usual. Obviously API taking more time to figure that talking has stopped. Not the required answer of course.

 

So we need google to fix this.



[TOPIC: post.html]
#65

Scott Harrison

[GLOBAL: userInfoPane.html]
Scott Harrison
  • Corona Geek

  • 1,795 posts
  • Enterprise

You might try stopping the background music if you can.

[TOPIC: post.html]
#66

sirmania

[GLOBAL: userInfoPane.html]
sirmania
  • Contributor

  • 154 posts
  • Corona SDK

Hi Scott!

 

Your plugin is awesome!!!

Is it possible to add support for Apple TV? Apple TV 4th generation and 4K has a microphone in the remote control (for Siri). If Apple TV can be supported it would be a game changer for me  B)



[TOPIC: post.html]
#67

Scott Harrison

[GLOBAL: userInfoPane.html]
Scott Harrison
  • Corona Geek

  • 1,795 posts
  • Enterprise

Hi Scott!

Your plugin is awesome!!!
Is it possible to add support for Apple TV? Apple TV 4th generation and 4K has a microphone in the remote control (for Siri). If Apple TV can be supported it would be a game changer for me B)


Unfortunately Apple Speech framework is only support on iOS. I don’t even believe you can access the Apple TV remote microphone anyways.

[TOPIC: post.html]
#68

sirmania

[GLOBAL: userInfoPane.html]
sirmania
  • Contributor

  • 154 posts
  • Corona SDK

Ok!

 

I´m using an iPad and share the screen with the Apple TV, so I have access to the microphone on the iPad. This works but it would be much better to run the app on the Apple TV without the iPad. Well, well... maybe one day  :rolleyes:



[TOPIC: post.html]
#69

dmarques42

[GLOBAL: userInfoPane.html]
dmarques42
  • Enthusiast

  • 53 posts
  • Corona SDK

I have my Android phone (6.0.1) working well with this plugin, but I have a timing problem.

 

Context: my app is for helping young children volcalize; a word is read to them, then they say it back.

 

Problem: No matter what I have tried, I cannot get any sound out after voiceToText.startRecording(...) -- it blocks all audio, and I have tried audio.play as well as a texttospeech app. If I can fix this, that might do it for me.

 

That wouldn't be fatal except for the delay. I now play the phrase (eg, "Say bubble"), and start Recording as soon as that completes. But then the recording does not actually start for 1+ seconds after I send the startRecording message, and children are not that patient. I need to get this difference down to 200-300ms or less. 

 

I did note that doing an initial start/stop at app startup shortens the time for the first start after that, but they are still far too long. 

 

So, 2 problems: the time after startRecording and when it accepts sound is much too long for my use, and 2) I cannot start the recording ahead because it blocks all audio output. 

 

From the specs (and other comments) it seems that blocking all audio is probably a bug on my side? (I use "false" for the second argument, but it makes no difference what I put there, all sound is stopped.)

 

Phone is alcatel idol 3, but these children will not have high end phones/tablets anyway.

 



[TOPIC: post.html]
#70

Scott Harrison

[GLOBAL: userInfoPane.html]
Scott Harrison
  • Corona Geek

  • 1,795 posts
  • Enterprise

Unfortunately there is no good way to handle this, it is really and an android problem. Sorry to hear you are having these issues you could try using visual options or use the native google sounds that plays.

[TOPIC: post.html]
#71

Scott Harrison

[GLOBAL: userInfoPane.html]
Scott Harrison
  • Corona Geek

  • 1,795 posts
  • Enterprise

As for why audio stops, the os stops the audio no matter what. The Param is designed to stop google sound effect from playing.

[TOPIC: post.html]
#72

dmarques42

[GLOBAL: userInfoPane.html]
dmarques42
  • Enthusiast

  • 53 posts
  • Corona SDK

OK, thank you for the answer. I think I have improved it a lot by abandoning texttospeech (instructions of what word to say; I just use pre-recorded batch transactions from Amazon Polly) and just playing audio. That makes it a shorter and more reliable gap. We already use visuals, but these are very young kids (3-5) who have various attention issues, so the instructions "Harry, say bubble" is critical.

 

But now, today, voiceToText does not work at all. It was all working fine the past two days, but today, I get no error, I never get the 'started' e.response, and never get any recording. Did something happen to any servers or something? Is there a way for me to debug this? There is nothing at all in the log, just my own record that I did init and start (and stop), but nothing more.

 

Nothing is printed out, how do I figure out if it is my problem? I changed a lot of things in my code, but none of it in the routines that call voiceToText. Any suggestions?



[TOPIC: post.html]
#73

Scott Harrison

[GLOBAL: userInfoPane.html]
Scott Harrison
  • Corona Geek

  • 1,795 posts
  • Enterprise

I am not sure what is happening but are you connected to internet



[TOPIC: post.html]
#74

dmarques42

[GLOBAL: userInfoPane.html]
dmarques42
  • Enthusiast

  • 53 posts
  • Corona SDK

Yes, lots of stuff wouldn't work if that were a problem. But I borrowed back a different device that has the version I made yesterday and it works, so it clearly is something interacting with code I changed today (mostly replacing texToSpeech with audio.play). Do I have to worry about audio channels? But now that I know that the problem is somewhere in my app, I will track it down. But I am concerned that it stopped working after I changed other things. 

 

Anyway, thank you for your help. Feel free to suggest anything else I should check. I will try to roll back to get it working again.



[TOPIC: post.html]
#75

dmarques42

[GLOBAL: userInfoPane.html]
dmarques42
  • Enthusiast

  • 53 posts
  • Corona SDK

Solved it. Somehow, microphone permissions were turned off, even though they were explicitly requested in install. If my grandson had been playing with the phone, I would have blamed him, but must have been something I did. Anyway, no problem.

 

My delay is much shorter and more reliable using audio.play instead of textToSpeech, might be enough to get by with it. We'll see with user testing.


  • Scott Harrison likes this


[topic_controls]
Page 3 of 5 1 2 3 4 5
 
[/topic_controls]