PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV Mobile 2024 → Speech Synthesis Text in iOS and Android Example
Speech Synthesis Text in iOS and Android Example
Started by adrianoboller, Nov., 20 2014 9:48 PM - 1 reply
Registered member
3,662 messages
Popularité : +175 (223 votes)
Posted on November, 20 2014 - 9:48 PM
-----
IOS()
#import <AVFoundation/AVFoundation.h>

void IOS(){}


-----

void IOS_LerTexto(NSString *const sMsg)
{
AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:sMsg];
AVSpeechSynthesizer *synth = [[AVSpeechSynthesizer alloc] init];
[synth speakUtterance:utterance];
}
Registered member
3,662 messages
Popularité : +175 (223 votes)
Posted on November, 20 2014 - 9:49 PM
Procedure Android_LerTexto(LOCAL Texto, LOCAL VibrarSN, LOCAL TooltipSN, LOCAL ComSemSom)

//CODE ANDROID - Use Target Code

ok is boolean = False

IF Texto <> "" AND Length(Texto) AND ComSemSom = "ComSom" THEN

IF InAndroidMode() = True THEN

ok = SpeechSynthesisInitialize(NationToLanguage(nationBrazilianPortuguese))

IF ok = True THEN

IF VibrarSN = "S"
VibrationTrigger(3000)
END

SpeechSynthesisReadText(Texto,True)

IF TooltipSN = "S"
Popup(Texto,"L")
END

IF VibrarSN = "S" THEN
VibrationTrigger(3000)
VibrationStop()
END

END

ELSE

IF TooltipSN = "S" THEN
Popup(Texto,"L")
ELSE
NextTitle("Atenção:")
Info(Texto)
END

IF VibrarSN = "S"
VibrationStop()
END

END


END

//CODE ANDROID