Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Text to Speech
Started by Michael W. Sep 15 2015 02:43 PM

308 replies to this topic
release android ios
[TOPIC CONTROLS]
Page 2 of 13 1 2 3 4 »
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#26

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Contributor

  • 533 posts
  • Corona Staff

Cheers for that.

 

Yeah I suppose it can't work like that, wouldn't make sense for the person listening. Same if you try and use Google translate for app descriptions, it doesn't read well.

 

EDIT -

 

Another 2 questions.

 

Does your locale match system.getPreference( "locale", "identifier" ) ?

 

So I could set the language of the plugin from using this Corona function (iOS only)?

 

Is the default language always english or the default language of the device?

 

 

Dave

local lang = system.getPreference( "locale", "language" ) .. '-' .. system.getPreference( "locale", "country" )

Default language is always English. Simply 'en-US' value.



[TOPIC: post.html]
#27

gtatarkin

[GLOBAL: userInfoPane.html]
gtatarkin
  • Contributor

  • 366 posts
  • Corona SDK

BTW I dont know you should fix it (speak rate on iOS 9) cuz it can change in next iOS subversion :) Just put something like this to documantation:

if system.getInfo("environment") == "device" then
 
local checkIOS = system.getInfo("platformVersion")
 
local a,b=checkIOS:match"([^.]*).(.*)"
 
if tonumber(a) < 9 then
myApp.speakRate = 0.6
end
 
end


[TOPIC: post.html]
#28

bobyeh.1390

[GLOBAL: userInfoPane.html]
bobyeh.1390
  • Enthusiast

  • 72 posts
  • Corona SDK

Hi,

 

  Thank you for the excellent work.

 

  Just want to send a report to you. I test it on ASUS_T00G phone. Android 4.4.2.

 

  Speak in English is OK, but Speak Russian and Chinese (zh-TW) failed.

 

Bob



[TOPIC: post.html]
#29

juliusbangert

[GLOBAL: userInfoPane.html]
juliusbangert
  • Contributor

  • 157 posts
  • Corona SDK

Thank you, this is an excellent plugin...
A few quick questions :

• Is there anyway to save a speech snippet to an audio file and store on the device?
• Is there a way to use an onComplete callback when the speech has finished playing?
• Is there a way to return a predicted speech time in milliseconds?



[TOPIC: post.html]
#30

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Contributor

  • 533 posts
  • Corona Staff

Bob, thanks, looks like some devices don't have all speech engines preinstalled.

juliusbangert, iOS and Android speech API differ significantly and I had to use the common remainder. So no save to file, onComplete might be possible to make, but it would take a while. And no predicted time.



[TOPIC: post.html]
#31

dmarques42

[GLOBAL: userInfoPane.html]
dmarques42
  • Enthusiast

  • 51 posts
  • Corona SDK

Sorry for the dumb question, but what is the plugin string needed for build.settings? I wish those were put in the store listing. Just so happens Spiral Code Studio documentation page is down right now.



[TOPIC: post.html]
#32

Michael W.

[GLOBAL: userInfoPane.html]
Michael W.
  • Contributor

  • 276 posts
  • Alumni

settings = {
   plugins = {
      ['plugin.texttospeech'] = { publisherId = 'com.spiralcodestudio' },
    },
}


  • dmarques42 likes this

[TOPIC: post.html]
#33

dmarques42

[GLOBAL: userInfoPane.html]
dmarques42
  • Enthusiast

  • 51 posts
  • Corona SDK

Thank you! I wish all store plugins had that information on the page.



[TOPIC: post.html]
#34

Michael W.

[GLOBAL: userInfoPane.html]
Michael W.
  • Contributor

  • 276 posts
  • Alumni

Thank you! I wish all store plugins had that information on the page. I never would have guessed qrscanner for texttospeech. (I get it, I substituted texttospeech for qrscanner, works great.)

Sorry, my mistake. Please check the above post again.

 

I'll reach out to Lerg and ask what's up with his site.



[TOPIC: post.html]
#35

dmarques42

[GLOBAL: userInfoPane.html]
dmarques42
  • Enthusiast

  • 51 posts
  • Corona SDK

Thank you, Lerg, great module. I also am using it for an education app, a test-practice app (and maybe a test-taking app), particularly for students who aren't fast good readers. I am looking forward to onComplete functionality, it will make the flow a lot better (I don't show the answers until the question has been read, helping with focus). Thanks again, great stuff.



[TOPIC: post.html]
#36

juliusbangert

[GLOBAL: userInfoPane.html]
juliusbangert
  • Contributor

  • 157 posts
  • Corona SDK

Hi Lerg.
Any news on a possible onComplete callback function? This would be so so good. :)
Also, I realise that save audio to file functionality would be very difficult to implement but do you happen to know of any way in Corona to live record what's playing in the system audio as another (dirty) way to capture the speech?



[TOPIC: post.html]
#37

Lerg

[GLOBAL: userInfoPane.html]
Lerg
  • Contributor

  • 533 posts
  • Corona Staff

Hi Lerg.
Any news on a possible onComplete callback function? This would be so so good. :)
Also, I realise that save audio to file functionality would be very difficult to implement but do you happen to know of any way in Corona to live record what's playing in the system audio as another (dirty) way to capture the speech?

onComplete is relatively easy to implement on Android, but on iOS it requires a significant refactoring. Maybe next weekend I'll do it.

 

The dirtiest hack would be to use the microphone. On iOS it's not possible to record speech to a file.



[TOPIC: post.html]
#38

juliusbangert

[GLOBAL: userInfoPane.html]
juliusbangert
  • Contributor

  • 157 posts
  • Corona SDK

Thanks Lerg. Recording the speech through microphone would be super dirty indeed, not too keen to go down that route, I think I'd rather use an API like google TTS or just do without that feature in my app...
onComplete would be super though, at the moment I'm calculating each words number of syllables and estimating speech time by the rate set ( which is dirty and inaccurate ).



[TOPIC: post.html]
#39

runewinse

[GLOBAL: userInfoPane.html]
runewinse
  • Contributor

  • 485 posts
  • Corona SDK

...



[TOPIC: post.html]
#40

Kevin H

[GLOBAL: userInfoPane.html]
Kevin H
  • Contributor

  • 130 posts
  • Corona SDK

Awesome work, fit right into a project I'm currently building. Just want to put in a vote for a callback, sure would be useful!



[TOPIC: post.html]
#41

vimaleee1994

[GLOBAL: userInfoPane.html]
vimaleee1994
  • Observer

  • 25 posts
  • Corona SDK

WARNING: The 'plugin.texttospeech' library is not available on this platform.

I'm getting this warning in my simulator



[TOPIC: post.html]
#42

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,537 posts
  • Enterprise

Most plugins don't work in the simulator because they depend on SDKs that are only available on actual devices. Build for device and install on a real device to test this feature.

 

Rob



[TOPIC: post.html]
#43

goofeenoodle

[GLOBAL: userInfoPane.html]
goofeenoodle
  • Observer

  • 12 posts
  • Corona SDK

Great work! Thank you so much! But I have a problem with speak rate, on iOS 8 , i set rate  = 0.6, on iOS 9 rate = 1. What if the rate changes in the update of iOS, is there a function to get the right speak rate from the OS? How about on android which rate is proper to which android OS version ? Does the rate depend on the android device? Is there a function to get the correct speak rate across the board? 



[TOPIC: post.html]
#44

goofeenoodle

[GLOBAL: userInfoPane.html]
goofeenoodle
  • Observer

  • 12 posts
  • Corona SDK

It would be so great if there were a onComplete callback function. I want to do some stuff  after an instruction text is read completely. Without this, I have to use timer.performWithDelay() function , but it is so hard to know how long it takes to finish reading the text.



[TOPIC: post.html]
#45

corona68

[GLOBAL: userInfoPane.html]
corona68
  • Observer

  • 12 posts
  • Corona SDK

Hi. I tested sample code on my Xiaomi Redmi Note 3 (with USB debuging enable) and run with no errors, but  also NO SOUND - no speech in any language :-( Corona is in last version 2016.2830.

Any idea what is wrong ?

Thanks



[TOPIC: post.html]
#46

goofeenoodle

[GLOBAL: userInfoPane.html]
goofeenoodle
  • Observer

  • 12 posts
  • Corona SDK

Can I test this on iOS simulator(not corona simulator)?



[TOPIC: post.html]
#47

gtatarkin

[GLOBAL: userInfoPane.html]
gtatarkin
  • Contributor

  • 366 posts
  • Corona SDK

Can I test this on iOS simulator(not corona simulator)?

 

yes you do starting from iOS 8.x simulator



[TOPIC: post.html]
#48

juliusbangert

[GLOBAL: userInfoPane.html]
juliusbangert
  • Contributor

  • 157 posts
  • Corona SDK

Great work! Thank you so much! But I have a problem with speak rate, on iOS 8 , i set rate  = 0.6, on iOS 9 rate = 1. What if the rate changes in the update of iOS, is there a function to get the right speak rate from the OS? How about on android which rate is proper to which android OS version ? Does the rate depend on the android device? Is there a function to get the correct speak rate across the board? 

@goofeenoodle... Did you come to a nice conclusion with the rate? I have a setting option for users to set the rate but want to initiate the app with a default. I guess I can do a device detect and set 0.6 or 1.0 for ios... but what should I do for Android ? Is one the default value for Android now? 



[TOPIC: post.html]
#49

juliusbangert

[GLOBAL: userInfoPane.html]
juliusbangert
  • Contributor

  • 157 posts
  • Corona SDK

Also is the flowing still true :


local rateRange = { min = 0.5, max = 2.0 }
local pitchRange = { min = 0.5, max = 2.0 }
local volumeRange = { min = 0.0, max = 1.0 }

I find the inconsistencies in the ranges and defaults a bit confusing.



[TOPIC: post.html]
#50

runewinse

[GLOBAL: userInfoPane.html]
runewinse
  • Contributor

  • 485 posts
  • Corona SDK

 

Also is the flowing still true :


local rateRange = { min = 0.5, max = 2.0 }
local pitchRange = { min = 0.5, max = 2.0 }
local volumeRange = { min = 0.0, max = 1.0 }

I find the inconsistencies in the ranges and defaults a bit confusing.

 

 

Me to. The pitch settings make some sort of sense on my Android devices, but on my iPad (iOS 9.2.1) the above pitch range is not what I experience at all...

 

Here's how it behaves on my iPad:

 

https://youtu.be/NTBkNf-V5zU

 

The pitch is shown in the upper left corner of the screen.

 

I my experience the pitch works like this:

 

0.500 - 0.999  Slow to normal

1.000 - 2.000 Stupid fast (and seems to be the same from 1.0 and up)




[topic_controls]
Page 2 of 13 1 2 3 4 »
 
[/topic_controls]

Also tagged with one or more of these keywords: release, android, ios