]> _ Git - cubist_azuretts.git/commitdiff
wip #5521 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 12 Oct 2022 14:55:04 +0000 (16:55 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 12 Oct 2022 14:55:04 +0000 (16:55 +0200)
.idea/deployment.xml
composer.json
composer.lock
src/Api.php

index 7f8d6c388edca43cff6afd0a7f97de660f22ade0..3ec89a58f4ffd6800637268bb6ea6cf92c2d0c3e 100644 (file)
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
-  <component name="PublishConfigData" autoUpload="Always" serverName="extranet.cubedesigners.com" remoteFilesAllowedToDisappearOnAutoupload="false">
+  <component name="PublishConfigData" autoUpload="Always" serverName="toolbox.fluidbook.com" remoteFilesAllowedToDisappearOnAutoupload="false" confirmBeforeUploading="false">
+    <option name="confirmBeforeUploading" value="false" />
     <serverData>
       <paths name="batman.cubedesigners.com">
         <serverdata>
       <paths name="toolbox.fluidbook.com">
         <serverdata>
           <mappings>
-            <mapping local="$PROJECT_DIR$" web="/" />
+            <mapping deploy="/vendor/cubist/azuretts" local="$PROJECT_DIR$" web="/" />
           </mappings>
+          <excludedPaths>
+            <excludedPath local="true" path="vendor" />
+          </excludedPaths>
         </serverdata>
       </paths>
       <paths name="workshop.fluidbook.com">
index 7578576225d53e76959238c6933cca3b38f73056..458d9ffe290fde23b24be16c38b3502ee4362b99 100644 (file)
@@ -26,5 +26,8 @@
     "ext-mbstring": "*",
     "ext-json": "*",
     "guzzlehttp/guzzle": "^7.4"
+  },
+  "suggest": {
+    "laravel/framework": "^5.8|^6.0|^7.0|^8.0"
   }
 }
index 52879cb8c5f0da80c80b09ef2a475d0aaceca8cd..c7c61aa4f345bc22de2bb9c64b98b7ed77e97dda 100644 (file)
             "source": {
                 "type": "git",
                 "url": "https://github.com/guzzle/guzzle.git",
-                "reference": "c1fd316f0a0f3325ed1e7cdbe61030418b868f9f"
+                "reference": "82ca75f0b1f130f018febdda29af13086da5dbac"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/c1fd316f0a0f3325ed1e7cdbe61030418b868f9f",
-                "reference": "c1fd316f0a0f3325ed1e7cdbe61030418b868f9f",
+                "url": "https://api.github.com/repos/guzzle/guzzle/zipball/82ca75f0b1f130f018febdda29af13086da5dbac",
+                "reference": "82ca75f0b1f130f018febdda29af13086da5dbac",
                 "shasum": ""
             },
             "require": {
                 }
             },
             "autoload": {
-                "psr-4": {
-                    "GuzzleHttp\\": "src/"
-                },
                 "files": [
                     "src/functions_include.php"
-                ]
+                ],
+                "psr-4": {
+                    "GuzzleHttp\\": "src/"
+                }
             },
             "notification-url": "https://packagist.org/downloads/",
             "license": [
                     "type": "tidelift"
                 }
             ],
-            "time": "2021-12-13T16:13:08+00:00"
+            "time": "2022-03-20T14:21:21+00:00"
         },
         {
             "name": "guzzlehttp/promises",
                 }
             },
             "autoload": {
-                "psr-4": {
-                    "GuzzleHttp\\Promise\\": "src/"
-                },
                 "files": [
                     "src/functions_include.php"
-                ]
+                ],
+                "psr-4": {
+                    "GuzzleHttp\\Promise\\": "src/"
+                }
             },
             "notification-url": "https://packagist.org/downloads/",
             "license": [
             "source": {
                 "type": "git",
                 "url": "https://github.com/guzzle/psr7.git",
-                "reference": "c5b547b9904106507e48c645b76ff74f18eea84e"
+                "reference": "5c693242bede743c23402bc5b9de62da04a882d7"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/guzzle/psr7/zipball/c5b547b9904106507e48c645b76ff74f18eea84e",
-                "reference": "c5b547b9904106507e48c645b76ff74f18eea84e",
+                "url": "https://api.github.com/repos/guzzle/psr7/zipball/5c693242bede743c23402bc5b9de62da04a882d7",
+                "reference": "5c693242bede743c23402bc5b9de62da04a882d7",
                 "shasum": ""
             },
             "require": {
                     "type": "tidelift"
                 }
             ],
-            "time": "2022-01-02T11:26:46+00:00"
+            "time": "2022-03-24T01:07:58+00:00"
         },
         {
             "name": "psr/http-client",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/deprecation-contracts.git",
-                "reference": "893fd20d9ae41a0bae2b9cbdd581ac0cf3917de3"
+                "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/893fd20d9ae41a0bae2b9cbdd581ac0cf3917de3",
-                "reference": "893fd20d9ae41a0bae2b9cbdd581ac0cf3917de3",
+                "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918",
+                "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918",
                 "shasum": ""
             },
             "require": {
-                "php": ">=8.0.2"
+                "php": ">=8.1"
             },
             "default-branch": true,
             "type": "library",
                     "type": "tidelift"
                 }
             ],
-            "time": "2021-11-29T18:10:03+00:00"
+            "time": "2022-02-25T11:15:52+00:00"
         }
     ],
     "packages-dev": [],
index ba038f65304493c8bea41d146254e5d6ff406d32..9f8f9f681e9428e2e1d2a41e71e33517e0b7e8e6 100644 (file)
@@ -53,10 +53,32 @@ class Api
         ], $ssml, ['sink' => $saveToFile]);
     }
 
-    public function listVoices()
+    public function listVoices($raw = false)
     {
-        $res = $this->_call('/voices/list');
-        return json_decode($res->getBody()->getContents());
+        if (function_exists('cache')) {
+            $cacheKey = 'azure_tts_voices_' . $raw;
+            cache()->forget($cacheKey);
+            return cache()->remember($cacheKey, 86400, function () use ($raw) {
+                return $this->_listVoices($raw);
+            });
+        } else {
+            return $this->_listVoices($raw);
+        }
+
+    }
+
+    protected function _listVoices($raw = false)
+    {
+        $resp = $this->_call('/voices/list');
+        $j = json_decode($resp->getBody()->getContents(), true);
+        if ($raw) {
+            return $j;
+        }
+        $res = [];
+        foreach ($j as $voice) {
+            $res[$voice['Locale'] . '/' . $voice['Gender'] . '/' . $voice['ShortName']] = $voice['DisplayName'] . ' / ' . $voice['Gender'] . ' / ' . $voice['LocaleName'];
+        }
+        return $res;
     }
 
     /**