[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
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
So much arguing for nothing, if it's broken why not try to fix it? Bing has a translator maybe it will work with that?
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
monday said:
the exclamation mark isn't the most friendly end of statement especially if the statement itself attempts to correct someone

I assume he's russian, so this exclamation mark may mean a bit different thing due to some excuses in language
 

_C1ph3r_

Active member
Joined
Feb 5, 2017
Messages
91
Reaction score
3
supahdupahnubah said:
monday said:
the exclamation mark isn't the most friendly end of statement especially if the statement itself attempts to correct someone

I assume he's russian, so this exclamation mark may mean a bit different thing due to some excuses in language
Yeah, there are many things stop me from communicating with others, i'm not good at English enough to understand whole thing, but i might improve my English and also my scripting skills when i use UG-Base
 
Top