Raised This Month: $71 Target: $400
 17% 

[STOCK] Voice Ware (Text To Speech)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 07-31-2014 , 18:19   [STOCK] Voice Ware (Text To Speech)
Reply With Quote #1

I made this stock for use a "Text To Speech" feature in SourceMod easily.


Stocks:
PHP Code:
/**
 * Sent text to speech to a client
 *
 * @param client            Client target.
 * @param language           Language of voice.
 * @param text            Text to reproduce.
 *                
 */
stock void VoiceWare(int clientchar[] languagechar[] text
{
    
ReplaceString(text255"&"""); // prevent error
    
char buffer[255];
    
Format(buffersizeof(buffer), "https://translate.google.com/translate_tts?ie=UTF-8&q=%s&tl=%s&client=tw-ob&ttsspeed=1.0"textlanguage); // use google traductor TTS
    
Handle Radio CreateKeyValues("data");
    
KvSetString(Radio"title""Voice Ware");
    
KvSetString(Radio"type""2");
    
KvSetString(Radio"msg"buffer);
    
ShowVGUIPanel(client"info"Radiofalse);
    
CloseHandle(Radio);
}

/**
 * Sent text to speech to all clients
 *
 * @param language           Language of voice.
 * @param text            Text to reproduce.
 *                
 */
stock void VoiceWareToAll(char[] languagechar[] text
{
    for (
int i 1<= MaxClientsi++)
        if(
IsClientInGame(i))
            
VoiceWare(ilanguagetext); 


Example plugin:
PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <voiceware>
 
#define LANGUAGE "en" // language voice used

public Plugin myinfo =
{
    
name "SM Chat text to voice",
    
description "Text to voice",
    
author "Franc1sco franug",
    
version "1.0",
    
url "http://steamcommunity.com/id/franug"
};

public 
void OnPluginStart()
{
    
RegConsoleCmd("say"Say);
}
 
public 
Action Say(int clientint args)
{
    if (
client!=0)
    {
        
char buffer[255];
        
GetCmdArgString(buffer,sizeof(buffer));
        
StripQuotes(buffer);
        
VoiceWareToAll(LANGUAGEbuffer);
    }  
    return 
Plugin_Continue;

Attached Files
File Type: inc voiceware.inc (1.0 KB, 36 views)
File Type: sp Get Plugin or Get Source (voiceware_test.sp - 39 views - 602 Bytes)
File Type: smx voiceware_test.smx (4.5 KB, 29 views)
__________________
Veteran SourceMod Coder
Taking paid requests -> Add me in TELEGRAM or STEAM
You like my work? donate me


Last edited by Franc1sco; 08-29-2018 at 08:43.
Franc1sco is offline
Send a message via MSN to Franc1sco Send a message via Skype™ to Franc1sco
robotortoise
Senior Member
Join Date: Nov 2013
Location: Somewhere in the US
Old 07-31-2014 , 18:59   Re: [STOCK] Voice Ware (Text To Speech)
Reply With Quote #2

This looks really cool! Are you gonna implement it into a plugin?

Maybe something like saying "!tts poop" would read it aloud.

Or you could make it a clientside toggle setting.


EDIT: I'm an idiot
__________________
-Robotortoise [Palutena's Bro]

If you ever need help with Wii/Gamecube/DS sounds/music/ect., I'm your man!

Contact me via Steam

I don't bite.


How to loop and compress .wav files

Me and my friends' server

Last edited by robotortoise; 07-31-2014 at 23:51.
robotortoise is offline
braak0327
AlliedModders Donor
Join Date: Dec 2012
Location: NORT....SOUTH KOREA
Old 07-31-2014 , 22:09   Re: [STOCK] Voice Ware (Text To Speech)
Reply With Quote #3

Super COOOOOOOOOOOOOOOOOOOL
__________________
I'M KIMCHI
braak0327 is offline
Send a message via Skype™ to braak0327
robotortoise
Senior Member
Join Date: Nov 2013
Location: Somewhere in the US
Old 07-31-2014 , 23:52   Re: [STOCK] Voice Ware (Text To Speech)
Reply With Quote #4

So that test plugin....it works, but only for some people.

Also it restricted teams.

Worked for me though.
__________________
-Robotortoise [Palutena's Bro]

If you ever need help with Wii/Gamecube/DS sounds/music/ect., I'm your man!

Contact me via Steam

I don't bite.


How to loop and compress .wav files

Me and my friends' server
robotortoise is offline
robotortoise
Senior Member
Join Date: Nov 2013
Location: Somewhere in the US
Old 08-01-2014 , 02:05   Re: [STOCK] Voice Ware (Text To Speech)
Reply With Quote #5

Maybe someone could implement it into this?
__________________
-Robotortoise [Palutena's Bro]

If you ever need help with Wii/Gamecube/DS sounds/music/ect., I'm your man!

Contact me via Steam

I don't bite.


How to loop and compress .wav files

Me and my friends' server
robotortoise is offline
braak0327
AlliedModders Donor
Join Date: Dec 2012
Location: NORT....SOUTH KOREA
Old 08-01-2014 , 03:49   Re: [STOCK] Voice Ware (Text To Speech)
Reply With Quote #6

Quote:
Originally Posted by robotortoise View Post
Maybe someone could implement it into this?
chat bot union like this thread
__________________
I'M KIMCHI
braak0327 is offline
Send a message via Skype™ to braak0327
robotortoise
Senior Member
Join Date: Nov 2013
Location: Somewhere in the US
Old 08-01-2014 , 04:32   Re: [STOCK] Voice Ware (Text To Speech)
Reply With Quote #7

Quote:
Originally Posted by braak0327 View Post
chat bot union like this thread
I've posted about MegaHAL before, but no one seems to be interested in fixing him up.
__________________
-Robotortoise [Palutena's Bro]

If you ever need help with Wii/Gamecube/DS sounds/music/ect., I'm your man!

Contact me via Steam

I don't bite.


How to loop and compress .wav files

Me and my friends' server
robotortoise is offline
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 08-01-2014 , 08:07   Re: [STOCK] Voice Ware (Text To Speech)
Reply With Quote #8

voiceware is a brand that has nothing to do with google translate text to speech...
__________________
Taking private C++/PHP/SourcePawn requests, PM me.
Zephyrus is offline
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 08-01-2014 , 08:09   Re: [STOCK] Voice Ware (Text To Speech)
Reply With Quote #9

Quote:
Originally Posted by robotortoise View Post
So that test plugin....it works, but only for some people.

Also it restricted teams.

Worked for me though.
i think it wont work for anyone with disabled motds or without standalone flash installed (chrome has it embedded)
__________________
Taking private C++/PHP/SourcePawn requests, PM me.

Last edited by Zephyrus; 08-01-2014 at 08:10.
Zephyrus is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 08-01-2014 , 12:32   Re: [STOCK] Voice Ware (Text To Speech)
Reply With Quote #10

Quote:
Originally Posted by Zephyrus View Post
voiceware is a brand that has nothing to do with google translate text to speech...
Yeah but anyway to me it looked like a good name xD and I have put so, for the idea of braak0327

Quote:
Originally Posted by Zephyrus View Post
i think it wont work for anyone with disabled motds or without standalone flash installed (chrome has it embedded)
this will not work with people that have disabled motds, but the flash installed I am not sure, I know that fragradio plugin need it, but I am not sure if for can hear sounds of any motd the flash is required
__________________
Veteran SourceMod Coder
Taking paid requests -> Add me in TELEGRAM or STEAM
You like my work? donate me


Last edited by Franc1sco; 08-01-2014 at 13:41.
Franc1sco is offline
Send a message via MSN to Franc1sco Send a message via Skype™ to Franc1sco
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:16.


Powered by vBulletin®
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Theme made by Freecode