1 | <?php |
||
23 | class Speak implements \badams\MicrosoftTranslator\ApiMethodInterface |
||
24 | { |
||
25 | const TEXT_MAX_LENGTH = 2000; |
||
26 | |||
27 | const FORMAT_MP3 = 'audio/mp3'; |
||
28 | const FORMAT_WAV = 'audio/wav'; |
||
29 | |||
30 | const OPTION_MAX_QUALITY = 'MaxQuality'; |
||
31 | const OPTION_MIN_SIZE = 'MinSize'; |
||
32 | |||
33 | /** |
||
34 | * @var Language |
||
35 | */ |
||
36 | protected $language; |
||
37 | |||
38 | /** |
||
39 | * @var string |
||
40 | */ |
||
41 | protected $text; |
||
42 | |||
43 | /** |
||
44 | * @var string |
||
45 | */ |
||
46 | protected $format; |
||
47 | |||
48 | /** |
||
49 | * @var string |
||
50 | */ |
||
51 | protected $options; |
||
52 | |||
53 | /** |
||
54 | * Speak constructor. |
||
55 | * @param $text |
||
56 | * @param $language |
||
57 | * @param string $format |
||
58 | * @param string $options |
||
59 | */ |
||
60 | 15 | public function __construct($text, $language, $format = Speak::FORMAT_MP3, $options = Speak::OPTION_MAX_QUALITY) |
|
83 | |||
84 | /** |
||
85 | * @return string |
||
86 | */ |
||
87 | 3 | public function getRequestMethod() |
|
91 | |||
92 | /** |
||
93 | * @return array |
||
94 | */ |
||
95 | 3 | public function getRequestOptions() |
|
104 | |||
105 | /** |
||
106 | * @param \GuzzleHttp\Message\ResponseInterface $response |
||
107 | * @return string |
||
108 | */ |
||
109 | 3 | public function processResponse(\GuzzleHttp\Message\ResponseInterface $response) |
|
113 | |||
114 | |||
115 | } |