[SNIPPET] Read the text with Google's Voice

Simply, read your chatlog with google translator's voice, it was made by Opcode ! I just release it !
Snippet:
Code:
:VOICE_SAY_TEXT
IF
0AAB:  file_exists "CLEO\downloads\voice.mp3"
THEN
    0B00: delete_file "CLEO\downloads\voice.mp3"
END     
0AC8: 2@ = allocate_memory_size 260
0ad3: 2@ = "http:%c%ctranslate.google.com/translate_tts?tl=%s&q=%s" 47 47 1@ 0@
0D92: 3@ = download_query url 2@ local_file "voice.mp3"
REPEAT
    WAIT 0     
    0D93: download_query 3@ get_state_to 4@ 
UNTIL 4@ == 0
0AAC: 4@ = load_audiostream "CLEO\downloads\voice.mp3"
0AAD: set_mp3 4@ perform_action 1
0AC0: audiostream 4@ loop 0
0ABC: set_audiostream 4@ volume 1.0
REPEAT
WAIT 0 
    0AB9: get_audio_stream_state 4@ store_to 5@
UNTIL 5@ == -1
0AAE: release_mp3 4@
0AC9: free_allocated_memory 2@
0AB2: 0


Full Example ( Press R and the text will be read by Google ):
Code:
{$CLEO .cs}
0000:

REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY

WHILE TRUE
    WAIT 0
    IF
    0AB0: 82
    THEN
        0AC8: 0@ = allocate_memory_size 260
        0AC8: 1@ = allocate_memory_size 260
        0AB1: @GETCHATENTRYTEXT 1 ID 99 0@
        0AD3: 1@ = "en"
        0AB1: @VOICE_SAY_TEXT 2 0@ LANGUAGE 1@ 
        0AC9: free_allocated_memory 0@
        0AC9: free_allocated_memory 1@
    END
END

:getChatEntryText
0AF7: samp 1@ = get_base
1@ += 0x212A6C
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
1@ += 0x136
0@ *= 0xFC
005A: 1@ += 0@
1@ += 0x1C
0AB2: 1 1@

//0AB1: @VOICE_SAY_TEXT 2 0@ LANGUAGE 1@
:VOICE_SAY_TEXT
IF
0AAB:  file_exists "CLEO\downloads\voice.mp3"
THEN
    0B00: delete_file "CLEO\downloads\voice.mp3"
END     
0AC8: 2@ = allocate_memory_size 260
0ad3: 2@ = "http:%c%ctranslate.google.com/translate_tts?tl=%s&q=%s" 47 47 1@ 0@
0D92: 3@ = download_query url 2@ local_file "voice.mp3"
REPEAT
    WAIT 0     
    0D93: download_query 3@ get_state_to 4@ 
UNTIL 4@ == 0
0AAC: 4@ = load_audiostream "CLEO\downloads\voice.mp3"
0AAD: set_mp3 4@ perform_action 1
0AC0: audiostream 4@ loop 0
0ABC: set_audiostream 4@ volume 1.0
REPEAT
WAIT 0 
    0AB9: get_audio_stream_state 4@ store_to 5@
UNTIL 5@ == -1
0AAE: release_mp3 4@
0AC9: free_allocated_memory 2@
0AB2: 0
 

iVilux

Well-known member
Joined
Nov 12, 2013
Messages
207
Reaction score
5
_C1ph3r_ said:
iVilux said:
Crash for me?
This Snippet is depending on Sampfuncs and also it just a snippet not a cleo script !

And also, it's 2 and a half years old, and also, I have SAMPFUNCS, and also, you included a script, and also, it's a shitty copy paste and you should be ashamed of yourself.
 

_C1ph3r_

Active member
Joined
Feb 5, 2017
Messages
91
Reaction score
3
iVilux said:
_C1ph3r_ said:
iVilux said:
Crash for me?
This Snippet is depending on Sampfuncs and also it just a snippet not a cleo script !

And also, it's 2 and a half years old, and also, I have SAMPFUNCS, and also, you included a script, and also, it's a shitty copy paste and you should be ashamed of yourself.
I already told u that the author is Opcode


0x32789 said:
what more do you expect when you have access denied error 403?
Access to translate.google.com was denied

You don't have authorization to view this page.
HTTP ERROR 403
Check your internet connection, reset your device and then try again, or maybe add your own link of google !
 

iVilux

Well-known member
Joined
Nov 12, 2013
Messages
207
Reaction score
5
_C1ph3r_ said:
iVilux said:
_C1ph3r_ said:
iVilux said:
Crash for me?
This Snippet is depending on Sampfuncs and also it just a snippet not a cleo script !

And also, it's 2 and a half years old, and also, I have SAMPFUNCS, and also, you included a script, and also, it's a shitty copy paste and you should be ashamed of yourself.
I already told u that the author is Opcode


0x32789 said:
what more do you expect when you have access denied error 403?
Access to translate.google.com was denied

You don't have authorization to view this page.
HTTP ERROR 403
Check your internet connection, reset your device and then try again, or maybe add your own link of google !



This isn't internet connection, dumbass.
 

0x32789

Expert
Joined
May 26, 2014
Messages
849
Reaction score
51
Location
LongForgotten <-> 0x32789
yep, its not internet connection. Google will automatically block you for some time if you keep spamming or sending connections to it.
 

iVilux

Well-known member
Joined
Nov 12, 2013
Messages
207
Reaction score
5
0x32789 said:
yep, its not internet connection. Google will automatically block you for some time if you keep spamming or sending connections to it.
And also, he is using old opcodes... I'm trying to fix it and use other site rather than Google.
 

_C1ph3r_

Active member
Joined
Feb 5, 2017
Messages
91
Reaction score
3
iVilux said:
0x32789 said:
yep, its not internet connection. Google will automatically block you for some time if you keep spamming or sending connections to it.
And also, he is using old opcodes... I'm trying to fix it and use other site rather than Google.
The the google might flag your request as "Spamming" or "DDoSing"
 

_C1ph3r_

Active member
Joined
Feb 5, 2017
Messages
91
Reaction score
3
iVilux said:
0x32789 said:
yep, its not internet connection. Google will automatically block you for some time if you keep spamming or sending connections to it.
And also, he is using old opcodes... I'm trying to fix it and use other site rather than Google.
Yeah, Opcode uses old opcodes, and also i'm not a spammer ! I just feel excited in the first day i come to UG-Base, i want to support all the guys who help questions or something, so don't mark me a spammer ! If you feel annoying please use "Ignore" to stop seeing my notifications or posts or threads ! Thanks for reading ! Nice day, lady and man
 

Cinaro

Well-known member
Joined
Jun 30, 2015
Messages
277
Reaction score
5
It's old and not working, Garbage/spam
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
https://cloud.google.com/translate/pricing
The Google Translation API is priced monthly based on usage. Translation usage is calculated in millions of characters, where 1 million = 106 characters.

Prices per month
0-1.5 billion characters - $20 per 1,000,000 characters*
1.5 billion+Translation - $15 per 1,000,000 characters*
$15-$20 per month...

@_C1ph3r_
why delete? Even if it doesn't work now it can be useful for other things, I'd just add a disclaimer in the main post saying it doesn't work
 

_C1ph3r_

Active member
Joined
Feb 5, 2017
Messages
91
Reaction score
3
monday said:
https://cloud.google.com/translate/pricing
The Google Translation API is priced monthly based on usage. Translation usage is calculated in millions of characters, where 1 million = 106 characters.

Prices per month
0-1.5 billion characters - $20 per 1,000,000 characters*
1.5 billion+Translation - $15 per 1,000,000 characters*
$15-$20 per month...

@_C1ph3r_
why delete? Even if it doesn't work now it can be useful for other things, I'd just add a disclaimer in the main post saying it doesn't work
I don't know you guy is acting like: "Oh ! This topic is shitty and useless"
I feel so terrible, this is the first time i share a Snippet  :sadpepe:
Although the snippet wasn't created by me, i still feel happy because i can help this community
But, someone find that my topics, my posts, my threads is Spamming and i'm a spammer too !
I tried... :sadpepe:
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
the hate was just a response...
_C1ph3r_ said:
iVilux said:
Crash for me?
This Snippet is depending on Sampfuncs and also it just a snippet not a cleo script !
the exclamation mark isn't the most friendly end of statement especially if the statement itself attempts to correct someone and relies on false assumptions (that iVilux doesn't have sampfuncs and saying "not a cleo script" after posting something which appears to be whole cleo script)

Btw it's a good practice to test code before sharing and let people know if it works or not (or even state what exact software was used for testing because often it makes difference)

If you read again what 0x32789 wrote you'll notice that he didn't call you a spammer and referred to google translate spam
0x32789 said:
yep, its not internet connection. Google will automatically block you for some time if you keep spamming or sending connections to it.

action -> reaction :p

but the code itself is useful, shows what opcodes were used to download the file and play it
 

_C1ph3r_

Active member
Joined
Feb 5, 2017
Messages
91
Reaction score
3
monday said:
the hate was just a response...
_C1ph3r_ said:
iVilux said:
Crash for me?
This Snippet is depending on Sampfuncs and also it just a snippet not a cleo script !
the exclamation mark isn't the most friendly end of statement especially if the statement itself attempts to correct someone and relies on false assumptions (that iVilux doesn't have sampfuncs and saying "not a cleo script" after posting something which appears to be whole cleo script)

Btw it's a good practice to test code before sharing and let people know if it works or not (or even state what exact software was used for testing because often it makes difference)

If you read again what 0x32789 wrote you'll notice that he didn't call you a spammer and referred to google translate spam
0x32789 said:
yep, its not internet connection. Google will automatically block you for some time if you keep spamming or sending connections to it.

action -> reaction :p

but the code itself is useful, shows what opcodes were used to download the file and play it
Yes, he uses %C instead of using //, i couldnt write // in Sanny ::)
And his code help me so much then i decided to upload this snippet
 
Top