index.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (C) 2020 Tencent Cloud.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. 'use strict';
  17. const { request } = require('./utils');
  18. /**
  19. * 获取基础语音合成结果
  20. * 更多信息请访问 https://cloud.tencent.com/document/product/1073/37995
  21. * @param {object} params - 参数包装对象
  22. * @param {object} param - 语音合成接口相关参数
  23. * @return {Promise<object>} 评测信息
  24. */
  25. async function getTtsResult({ param }) {
  26. // 调用腾讯云基础语音合成接口
  27. const result = await request('TextToVoice', param);
  28. return result;
  29. }
  30. module.exports = {
  31. getTtsResult
  32. };