Module: SpeechCloud::AdditionalInfo
- Defined in:
- lib/speechcloud/additional_information.rb
Class Method Summary collapse
-
.check_text_price(voice_id, text) ⇒ Object
Check the characters price for a specified speech parameters (text and voice pair).
-
.get_user_agreement_data ⇒ Object
Show user TTS SaaS agreement data (this method will result in an error if there isn’t a SaaS agreement currently active for user).
-
.get_voice_data(voice_id) ⇒ Object
Get single voice data.
-
.list_codecs ⇒ Object
Get all available codecs list.
-
.list_voices ⇒ Object
Get all available voices list.
Class Method Details
.check_text_price(voice_id, text) ⇒ Object
Check the characters price for a specified speech parameters (text and voice pair)
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/speechcloud/additional_information.rb', line 4 def check_text_price(voice_id, text) token = SpeechCloud::Auth.get_token md5 = SpeechCloud::GetMd5.formula(token) params = [ "token=#{token}", "md5=#{md5}", "text=#{text}", "voiceId=#{voice_id}" ] params = params.join('&') HTTParty.get("#{BASE_URL}/textprice?#{params}") end |
.get_user_agreement_data ⇒ Object
Show user TTS SaaS agreement data (this method will result in an error if there isn’t a SaaS agreement currently active for user)
16 17 18 19 20 21 22 23 |
# File 'lib/speechcloud/additional_information.rb', line 16 def get_user_agreement_data token = SpeechCloud::Auth.get_token md5 = SpeechCloud::GetMd5.formula(token) params = [ "token=#{token}", "md5=#{md5}" ] params = params.join('&') HTTParty.get("#{BASE_URL}/agreementdata?#{params}") end |
.get_voice_data(voice_id) ⇒ Object
Get single voice data
36 37 38 39 40 41 42 43 |
# File 'lib/speechcloud/additional_information.rb', line 36 def get_voice_data( voice_id ) token = SpeechCloud::Auth.get_token md5 = SpeechCloud::GetMd5.formula(token) params = [ "token=#{token}", "md5=#{md5}" ] params = params.join('&') HTTParty.get("#{BASE_URL}/voices/#{voice_id}?#{params}") end |
.list_codecs ⇒ Object
Get all available codecs list
46 47 48 49 50 51 52 |
# File 'lib/speechcloud/additional_information.rb', line 46 def list_codecs token = SpeechCloud::Auth.get_token params = [ "token=#{token}", "md5=#{SpeechCloud::GetMd5.formula(token)}" ] params = params.join('&') HTTParty.get("#{BASE_URL}/codecs?#{params}") end |
.list_voices ⇒ Object
Get all available voices list
26 27 28 29 30 31 32 33 |
# File 'lib/speechcloud/additional_information.rb', line 26 def list_voices token = SpeechCloud::Auth.get_token md5 = SpeechCloud::GetMd5.formula(token) params = [ "token=#{token}", "md5=#{md5}" ] params = params.join('&') HTTParty.get("#{BASE_URL}/voices?#{params}") end |