also looking at this
meemalabs/laravel-text-to-speech
Support laravel 9
#32
17 files
+83
-61
formatting only · 8 hidden lines
| @@ -26,7 +26,7 @@ class PollyConverter implements Converter formatting only | ||
| 26 | 26 | /** |
| 27 | 27 | * Construct converter. |
| 28 | 28 | * |
| 29 | * @param PollyClient $client | |
| 29 | * @param PollyClient $client | |
| 30 | 30 | */ |
| 31 | 31 | public function __construct(PollyClient $client) |
| 32 | 32 | { |
| @@ -46,8 +46,8 @@ class PollyConverter implements Converter | ||
| 46 | 46 | /** |
| 47 | 47 | * Converts the text to speech. |
| 48 | 48 | * |
| 49 | * @param string $data | |
| 50 | * @param array $options | |
| 49 | * @param string $data | |
| 50 | * @param array|null $options | |
| 51 | 51 | * @return string|array |
| 52 | 52 | */ |
| 53 | 53 | public function convert(string $data, array $options = null) |
| @@ -81,8 +81,8 @@ class PollyConverter implements Converter | ||
| 81 | 81 | /** |
| 82 | 82 | * Request to Amazon Polly to synthesize speech. |
| 83 | 83 | * |
| 84 | * @param string|array $text | |
| 85 | * @param array $options | |
| 84 | * @param string|array $text | |
| 85 | * @param array|null $options | |
| 86 | 86 | * @return array|\Aws\Result |
| 87 | 87 | */ |
| 88 | 88 | protected function synthesizeSpeech($text, array $options = null) |
| @@ -111,7 +111,7 @@ class PollyConverter implements Converter | ||
| 111 | 111 | 'Text' => $textItem, |
| 112 | 112 | ])); |
| 113 | 113 | |
| 114 | array_push($results, $result); | |
| 114 | $results[] = $result; | |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | return $results; |
formatting only · 8 hidden lines
| @@ -135,7 +135,7 @@ class PollyConverter implements Converter formatting only | ||
| 135 | 135 | /** |
| 136 | 136 | * Checks the length of the text if more than 3000. |
| 137 | 137 | * |
| 138 | * @param string $text | |
| 138 | * @param string $text | |
| 139 | 139 | * @return bool |
| 140 | 140 | */ |
| 141 | 141 | protected function isTextAboveLimit(string $text) |
formatting only · 10 hidden lines
| @@ -146,8 +146,8 @@ class PollyConverter implements Converter formatting only | ||
| 146 | 146 | /** |
| 147 | 147 | * Chunk the given text into array. |
| 148 | 148 | * |
| 149 | * @param string $text | |
| 150 | * @param int $size | |
| 149 | * @param string $text | |
| 150 | * @param int $size | |
| 151 | 151 | * @return array |
| 152 | 152 | */ |
| 153 | 153 | protected function getChunkText(string $text, int $size = 2000) |
formatting only · 8 hidden lines
| @@ -158,7 +158,7 @@ class PollyConverter implements Converter formatting only | ||
| 158 | 158 | /** |
| 159 | 159 | * Get the text to speech voice ID. |
| 160 | 160 | * |
| 161 | * @param array $options | |
| 161 | * @param array $options | |
| 162 | 162 | * @return string |
| 163 | 163 | */ |
| 164 | 164 | protected function voice($options) |
formatting only · 8 hidden lines
| @@ -193,7 +193,7 @@ class PollyConverter implements Converter formatting only | ||
| 193 | 193 | /** |
| 194 | 194 | * Get the audio format. |
| 195 | 195 | * |
| 196 | * @param array $options | |
| 196 | * @param array $options | |
| 197 | 197 | * @return string |
| 198 | 198 | */ |
| 199 | 199 | protected function format($options) |
formatting only · 8 hidden lines
| @@ -210,7 +210,7 @@ class PollyConverter implements Converter formatting only | ||
| 210 | 210 | /** |
| 211 | 211 | * Get the engine. |
| 212 | 212 | * |
| 213 | * @param array $options | |
| 213 | * @param array $options | |
| 214 | 214 | * @return string |
| 215 | 215 | */ |
| 216 | 216 | protected function engine($options) |
formatting only · 8 hidden lines
| @@ -233,7 +233,7 @@ class PollyConverter implements Converter formatting only | ||
| 233 | 233 | /** |
| 234 | 234 | * Get the content of the result from AWS Polly. |
| 235 | 235 | * |
| 236 | * @param Result $result | |
| 236 | * @param Result $result | |
| 237 | 237 | * @return mixed |
| 238 | 238 | */ |
| 239 | 239 | protected function getResultContent($result) |
formatting only · 8 hidden lines
| @@ -254,7 +254,7 @@ class PollyConverter implements Converter formatting only | ||
| 254 | 254 | /** |
| 255 | 255 | * Format the given json string into an array. |
| 256 | 256 | * |
| 257 | * @param string $json | |
| 257 | * @param string $json | |
| 258 | 258 | * @return array |
| 259 | 259 | */ |
| 260 | 260 | protected function formatToArray($json) |