Sha256: 20ef3a6359b1ec940f74f343ebe9241b54db1b7c42be441368b80a9dc43b9ed4
Contents?: true
Size: 1.25 KB
Versions: 54
Compression:
Stored size: 1.25 KB
Contents
module Plivo module XML class Speak < Element @valid_attributes = %w[voice language loop] SUPPORTED_ENGINES=%w(Polly) SUPPORTED_VOICES=%w(Nicole Russell Vitoria Ricardo Chantal Naja Mads Lotte Ruben Lea Celine Mathieu Vicki Marlene Hans Aditi Dora Karl Raveena Aditi Carla Giorgio Mizuki Takumi Seoyeon Zhiyu Liv Ewa Maja Jacek Jan Ines Cristiano Carmen Tatyana Maxim Conchita Enrique Astrid Filiz Amy Emma Brian Joanna Matthew Salli Justin Kendra Joey Kimberly Ivy Penelope Miguel Gwyneth Geraint Zeina Mia) def initialize(body, attributes = {}) if attributes.nil? || attributes[:voice].nil? || ['MAN', 'WOMAN'].include?(attributes[:voice]) @nestables = [] else engine = attributes[:voice].split('.')[0] voice = attributes[:voice].split('.')[1] if SUPPORTED_ENGINES.include?(engine) && SUPPORTED_VOICES.include?(voice) @nestables = %w(Break Cont Emphasis Lang P Phoneme Prosody S SayAs Sub W) else raise PlivoXMLError, "<Speak> voice #{attributes[:voice]} is not valid." end end if !body raise PlivoXMLError, 'No text set for Speak' end super(body, attributes, @nestables) end end end end
Version data entries
54 entries across 54 versions & 1 rubygems