AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [STOCK] Voice Ware (Text To Speech) (https://forums.alliedmods.net/showthread.php?t=245351)

Franc1sco 07-31-2014 17:19

[STOCK] Voice Ware (Text To Speech)
 
3 Attachment(s)
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;



robotortoise 07-31-2014 17:59

Re: [STOCK] Voice Ware (Text To Speech)
 
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

braak0327 07-31-2014 21:09

Re: [STOCK] Voice Ware (Text To Speech)
 
Super COOOOOOOOOOOOOOOOOOOL

robotortoise 07-31-2014 22:52

Re: [STOCK] Voice Ware (Text To Speech)
 
So that test plugin....it works, but only for some people.

Also it restricted teams.

Worked for me though.

robotortoise 08-01-2014 01:05

Re: [STOCK] Voice Ware (Text To Speech)
 
Maybe someone could implement it into this?

braak0327 08-01-2014 02:49

Re: [STOCK] Voice Ware (Text To Speech)
 
Quote:

Originally Posted by robotortoise (Post 2177117)
Maybe someone could implement it into this?

chat bot union like this thread:)

robotortoise 08-01-2014 03:32

Re: [STOCK] Voice Ware (Text To Speech)
 
Quote:

Originally Posted by braak0327 (Post 2177151)
chat bot union like this thread:)

I've posted about MegaHAL before, but no one seems to be interested in fixing him up. :(

Zephyrus 08-01-2014 07:07

Re: [STOCK] Voice Ware (Text To Speech)
 
voiceware is a brand that has nothing to do with google translate text to speech...

Zephyrus 08-01-2014 07:09

Re: [STOCK] Voice Ware (Text To Speech)
 
Quote:

Originally Posted by robotortoise (Post 2177067)
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)

Franc1sco 08-01-2014 11:32

Re: [STOCK] Voice Ware (Text To Speech)
 
Quote:

Originally Posted by Zephyrus (Post 2177239)
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 (Post 2177241)
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


All times are GMT -4. The time now is 03:12.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.