CreateTtsResource.php 544 B

1234567891011121314151617181920212223
  1. <?php
  2. use Volc\Service\Notify;
  3. require('../../../vendor/autoload.php');
  4. require('../../src/Service/Notify.php');
  5. $client = Notify::getInstance();
  6. $client->setAccessKey("your ak");
  7. $client->setSecretKey("your sk");
  8. $body = [
  9. 'Name'=>'测试',
  10. 'TtsTemplateContent'=>'测试',
  11. 'Remark'=>"测试",
  12. 'TtsOption'=>"{\"loop\":0,\"loop_interval\":0,\"speed\":10,\"volume\":10,\"pitch\":10,\"voice_type\":\"BV001_streaming\",\"lang\":\"ch\",\"voice\":\"other\"}",
  13. ];
  14. $response = $client->CreateTtsResource($body);
  15. echo $response;