• Print

Author Topic: ulx tts or t2s  (Read 7437 times)

0 Members and 1 Guest are viewing this topic.

Offline Unknown Gamer

  • Jr. Member
  • **
  • Posts: 79
  • Karma: -2
    • TrueKnife TTT
ulx tts or t2s
« on: April 19, 2015, 03:07:40 pm »
Hi,

Ive been coding for so long but I can NOT get a ulx t2s to work. Could someone whip it up real quick? Its punching me in the ass because Ive tried so hard and I really think this could be fun for donors.
Newb Coder. Soon to get better

Offline XxLMM13xX

  • Sr. Member
  • ****
  • Posts: 265
  • Karma: -51
  • New to lua development
    • Twitch
Re: ulx tts or t2s
« Reply #1 on: April 19, 2015, 06:15:23 pm »
What exactly is t2s?

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: ulx tts or t2s
« Reply #2 on: April 19, 2015, 07:04:26 pm »
What exactly is t2s?
Text to speech, I would imagine.

If so, there's a good script out there on Facepunch that would probably make a great starting point.

If there's a pre-existing ULX T2S script that you're saying doesn't work, would you mind posting your code?
bw81@ulysses-forums ~ % whoami
Homepage

Offline Unknown Gamer

  • Jr. Member
  • **
  • Posts: 79
  • Karma: -2
    • TrueKnife TTT
Re: ulx tts or t2s
« Reply #3 on: April 22, 2015, 08:56:52 am »
Text to speech, I would imagine.

If so, there's a good script out there on Facepunch that would probably make a great starting point.

If there's a pre-existing ULX T2S script that you're saying doesn't work, would you mind posting your code?
Its really just an error. Heres the error I get
Warning: Unhandled usermessage 'ulib_url_sound'
Newb Coder. Soon to get better

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: ulx tts or t2s
« Reply #4 on: April 22, 2015, 03:10:51 pm »
Its really just an error. Heres the error I get
Warning: Unhandled usermessage 'ulib_url_sound'

Can't help you with an error if we don't know what's erroring.
Give us the code. We can't do anything without that.
bw81@ulysses-forums ~ % whoami
Homepage

Offline Unknown Gamer

  • Jr. Member
  • **
  • Posts: 79
  • Karma: -2
    • TrueKnife TTT
Re: ulx tts or t2s
« Reply #5 on: April 25, 2015, 07:13:05 pm »
Code: Lua
  1.                 CATEGORY_NAME = "Fun"          
  2.                 function ulx.t2s( calling_ply, what )                  
  3.                         if calling_ply and calling_ply:IsValid() then
  4.                                 what = string.Trim( what )
  5.                                 if what == "" then return end
  6.                                 what = string.gsub( what, ' ', '+' )
  7.                                 local t2s = '[url]http://www.voicerss.org/controls/speech.ashx?hl=en-us&c=mp3&rnd=1&src='[/url]
  8.                                 -- local t2s    = '[url]http://tts-api.com/tts.mp3?q='[/url]                   
  9.                                 umsg.Start('ulib_url_sound')
  10.                                         umsg.String( t2s .. what )
  11.                                 umsg.End()
  12.                         end
  13.                 end    
  14.                 for k, v in pairs( {"tts", "t2s" } ) do
  15.                         local piss = ulx.command( CATEGORY_NAME, "ulx "..v, ulx.t2s, "!"..v, true )
  16.                         piss:addParam{ type=ULib.cmds.StringArg, hint="text 2 speex to every1", ULib.cmds.takeRestOfLine }
  17.                         piss:defaultAccess( ULib.ACCESS_SUPERADMIN )
  18.                         piss:help( "Text2speex." )
  19.                 end    
Newb Coder. Soon to get better

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: ulx tts or t2s
« Reply #6 on: April 25, 2015, 10:19:55 pm »
If I remember correctly, that means the server is sending it but the client isn't trying to receive it.  You need to receive it clientside and it should fix the error.

Offline Unknown Gamer

  • Jr. Member
  • **
  • Posts: 79
  • Karma: -2
    • TrueKnife TTT
Re: ulx tts or t2s
« Reply #7 on: April 26, 2015, 10:42:29 am »
If I remember correctly, that means the server is sending it but the client isn't trying to receive it.  You need to receive it clientside and it should fix the error.
How would I fix that :P
Newb Coder. Soon to get better

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ulx tts or t2s
« Reply #8 on: April 26, 2015, 11:05:43 am »
Set a usermessage.Hook on the client side with the same usermessage name to do something with the string (or whatever else) you sent.
http://wiki.garrysmod.com/page/usermessage/Hook

Also, start shying away from usermessages.
Gmod13 has had depreciation warnings since it came out in October 2013 (or, can't remember, maybe 10/2012)
Research net library instead. Similar in usage, but overall much more capable.
http://wiki.garrysmod.com/page/Category:net
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

  • Print