<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      AI賦能音樂創作,人人都是音視頻創作者

      華為HMS Core音頻編輯服務(Audio Editor Kit)依托自身AI技術的研發優勢,上線全新的歌聲合成音色及伴奏,給音視頻創作者提供更多的創作可能。在短視頻場景中,用戶自定義歌詞的歌聲結合視頻讓用戶感受到身臨其境,自由表達自己的情緒;在虛擬偶像場景中,歌聲合成功能賦予虛擬歌手們演唱風格各異的歌曲,帶來創意無限。

      HMS Core音頻編輯服務歌聲合成的AI Singer模型能力通過字級別輸入歌詞進行音素轉換,就可以為用戶創作音樂,也可預置曲目合成歌聲。通過自研音高模型,讓音高曲線在保持輸入曲譜的音高精準度的同時改善自然度,更接近人的真實演唱。使用最新的生成式模型,帶來更好的音色還原度、建模更多的演唱細節,同時高清聲碼器能夠真實還原48k高清音質。

      另外,用戶通過自由調整顫音、滑音、呼吸音等功能,可根據情感需求調整歌聲演唱技巧。當前歌聲合成服務已開放了情流行女聲、國風女聲和民謠男聲音色,未來會持續更新更多音色。

      可點擊試聽音色效果:https://developer.huawei.com/consumer/cn/doc/development/Media-Guides/synthesis_timbre_audition-0000001336283673#section15944442132920?ha_source=hms1

      華為HMS Core音頻編輯服務(Audio Editor Kit)讓機器“演唱”出真實度的歌聲,僅需簡單的集成獲得,以下是開發者應用集成音頻編輯服務歌聲合成能力的具體步驟。

      開發步驟

      1. 開發準備

      1.1注冊成為開發者

      在開發應用前需要在華為開發者聯盟網站上注冊成為開發者并完成實名認證,具體方法請參見帳號注冊認證。

      1.2創建項目及應用

      參見創建項目,然后在項目下創建應用完成應用的創建,特殊配置如下:

      選擇平臺:選擇“Web”。

      1.3打開相關服務

      使用Audio Editor Kit服務需要您在AppGallery Connect上打開Audio Editor Kit服務開關,具體操作步驟請參見打開服務開關。

      2.歌聲合成功能集成

      2.1同步接口(流式)

      2.1.1獲取access_token鑒權信息

      使用開發者聯盟界面獲得的客戶端ID以及對應密鑰,發送HTTPS POST請求,獲取查詢access_token。獲取方式請參見客戶端模式(Client Credentials)。

      2.1.2調用同步接口(流式)

      通過以上步驟獲取的access_token信息,發送HTTPS POST調用同步接口(流式)。

      示例代碼(Java)如下所示:

      其中requestUrl = "https://audioeditor-api-drcn.cloud.huawei.com/v1/audioeditor/gateway/ai/ttsing/sync"。

      請點擊下載MusicXML文件,并上傳:

           /**
           * 調用同步接口(流式)
           * @throws Exception IO異常
           */
          private static void syncTask() throws Exception {
              // 設置請求header
              PostMethod postMethod = new PostMethod(requestUrl);
              // 設置文本類型(String),例:"application/json;charset=utf-8"
              postMethod.setRequestHeader("Content-Type", contentType);
              // 設置請求ID(String),例:"9af1aeda-531b-407a-80b4-65b40ef77bd6"
              postMethod.setRequestHeader("X-Request-ID", requestId);
              // 設置App包名(String),例:"com.huawei.demo"
              postMethod.setRequestHeader("X-Package-Name", pacageName);
              // 設置App所在國家(String),例:"cn"
              postMethod.setRequestHeader("X-Country-Code", countryCode);
              // 設置App標識(String),例:"9af1aeda-531b-407a-80b4-65b40ef77bd6"
              postMethod.setRequestHeader("HMS-APPLICATION-ID", applicationId);
              // 設置證書指紋(String),例:"xxxxxxxxxxxxxxx"
              postMethod.setRequestHeader("certFingerprint", certFingerprint);
              // 設置動態獲取的AccessToken(String)
              postMethod.setRequestHeader("Authorization","Bearer " + accessToken);
              // 設置請求body
              Map<String, Object> bodyMap = new HashMap<>();
              Map<String, Object> dataMap = new HashMap<>();
              Map<String, Object> configMap = new HashMap<>();
              // filePath是MusicXML文件路徑(含文件名、后綴)
              String lyricFilePath = "filePath";
              dataMap.put("lyric", FileUtils.readFileToString(new File(lyricFilePath), "UTF-8"));
              dataMap.put("language", "chinese");
              configMap.put("type", 1);
              configMap.put("outputEncoderFormat", 0);
              configMap.put("wordDurationForceAlign", "false");
              bodyMap.put("data", dataMap);
              bodyMap.put("config", configMap);
              RequestEntity requestEntity = new StringRequestEntity(JSONObject.toJSONString(bodyMap),"application/json" ,"UTF-8");
              postMethod.setRequestEntity(requestEntity);
      
              HttpClient httpClient = new HttpClient();
              int ret = httpClient.executeMethod(postMethod);
              if (ret == 200) {
                  Header responseHeader = postMethod.getResponseHeader("content-type");
                  if ("application/octet-stream".equals(responseHeader.getValue())) {
                      InputStream rpsContent = postMethod.getResponseBodyAsStream();
                      // filePath是要保存文件的路徑(含文件名、PCM文件后綴)
                      String filePath = "filePath";
                      FileUtils.copyInputStreamToFile(rpsContent, new File(filePath));
                  } else {
                      String errorString = postMethod.getResponseBodyAsString();
                      System.out.println(errorString);
                  }
              } else {
                  System.out.println("callApi failed: ret =" + ret + " rsp=" + postMethod.getResponseBodyAsString());
              }
          }
      

      使用預置曲目輸入歌詞:

         /**
           * 調用同步接口(流式)
           * @throws Exception IO異常
           */
          private static void syncTask() throws Exception {
              
              // 設置請求header
              PostMethod postMethod = new PostMethod(requestUrl);
              // 設置文本類型(String),例:"application/json;charset=utf-8"
              postMethod.setRequestHeader("Content-Type", contentType);
              // 設置請求ID(String),例:"9af1aeda-531b-407a-80b4-65b40ef77bd6"
              postMethod.setRequestHeader("X-Request-ID", requestId);
              // 設置App包名(String),例:"com.huawei.demo"
              postMethod.setRequestHeader("X-Package-Name", pacageName);
              // 設置App所在國家(String),例:"cn"
              postMethod.setRequestHeader("X-Country-Code", countryCode);
              // 設置App標識(String),例:"9af1aeda-531b-407a-80b4-65b40ef77bd6"
              postMethod.setRequestHeader("HMS-APPLICATION-ID", applicationId);
              // 設置證書指紋(String),例:"xxxxxxxxxxxxxxx"
              postMethod.setRequestHeader("certFingerprint", certFingerprint);
              // 設置動態獲取的AccessToken(String)
              postMethod.setRequestHeader("Authorization","Bearer " + accessToken);
              // 設置請求body
              Map<String, Object> bodyMap = new HashMap<>();
              Map<String, Object> dataMap = new HashMap<>();
              Map<String, Object> configMap = new HashMap<>();
              String[] lyrics = {"跟隨心跳的節拍", "感受自由的暢快", "把煩惱通通拋開", "我們一起嗨", "調整呼吸的節拍", "保持最好的狀態", "奔向耀眼的未來", "哦康忙北北"};
              dataMap.put("lyrics", lyrics);
              dataMap.put("accompanimentId", "1");
              dataMap.put("isAutoFill", "false");
              dataMap.put("language", "chinese");
              configMap.put("type", 1);
              configMap.put("outputEncoderFormat", 0);
              configMap.put("wordDurationForceAlign", "false");
              bodyMap.put("data", dataMap);
              bodyMap.put("config", configMap);
              RequestEntity requestEntity = new StringRequestEntity(JSONObject.toJSONString(bodyMap),"application/json" ,"UTF-8");
              postMethod.setRequestEntity(requestEntity);
      
              HttpClient httpClient = new HttpClient();
              int ret = httpClient.executeMethod(postMethod);
              if (ret == 200) {
                  Header responseHeader = postMethod.getResponseHeader("content-type");
                  if ("application/octet-stream".equals(responseHeader.getValue())) {
                      InputStream rpsContent = postMethod.getResponseBodyAsStream();
                      // filePath是要保存文件的路徑(含文件名、PCM文件后綴)
                      String filePath = "filePath";
                      FileUtils.copyInputStreamToFile(rpsContent, new File(filePath));
                  } else {
                      String errorString = postMethod.getResponseBodyAsString();
                      System.out.println(errorString);
                  }
              } else {
                  System.out.println("callApi failed: ret =" + ret + " rsp=" + postMethod.getResponseBodyAsString());
              }
          }
      

      注意:

      上述代碼中xxxxx對應的值請根據實際情況填寫,具體取值請參見同步接口(流式)

      2.2異步接口

      2.2.1創建異步任務

      通過access_token信息,發送HTTPS POST創建歌聲合成異步任務。

      示例代碼(Java)如下所示:

      其中requestUrl = "https://audioeditor-api-drcn.cloud.huawei.com/v1/audioeditor/gateway/ai/ttsing/async/task/create"。

      請點擊下載MusicXML文件,并上傳:

           /**
           * 調用創建異步任務接口
           * @throws Exception IO異常
           */
          private static void creatAsyncTask() throws Exception {
              
              // 設置請求header
              PostMethod postMethod = new PostMethod(requestUrl);
              // 設置文本類型(String),例:"application/json;charset=utf-8"
              postMethod.setRequestHeader("Content-Type", contentType);
              // 設置請求ID(String),例:"9af1aeda-531b-407a-80b4-65b40ef77bd6"
              postMethod.setRequestHeader("X-Request-ID", requestId);
              // 設置App包名(String),例:"com.huawei.demo"
              postMethod.setRequestHeader("X-Package-Name", pacageName);
              // 設置App所在國家(String),例:"cn"
              postMethod.setRequestHeader("X-Country-Code", countryCode);
              // 設置App標識(String),例:"9af1aeda-531b-407a-80b4-65b40ef77bd6"
              postMethod.setRequestHeader("HMS-APPLICATION-ID", applicationId);
              // 設置證書指紋(String),例:"xxxxxxxxxxxxxxx"
              postMethod.setRequestHeader("certFingerprint", certFingerprint);
              // 設置動態獲取的AccessToken(String)
              postMethod.setRequestHeader("Authorization","Bearer " + accessToken);
              // 設置請求body
              Map<String, Object> bodyMap = new HashMap<>();
              Map<String, Object> dataMap = new HashMap<>();
              Map<String, Object> configMap = new HashMap<>();
              // filePath是MusicXML文件路徑(含文件名、后綴)
              String lyricFilePath = "filePath";
              dataMap.put("lyric", FileUtils.readFileToString(new File(lyricFilePath), "UTF-8"));
              dataMap.put("language", "chinese");
              configMap.put("type", 1);
              configMap.put("outputEncoderFormat", 0);
              configMap.put("wordDurationForceAlign", "false");
              bodyMap.put("data", dataMap);
              bodyMap.put("config", configMap);
              RequestEntity requestEntity = new StringRequestEntity(JSONObject.toJSONString(bodyMap),"application/json" ,"UTF-8");
              postMethod.setRequestEntity(requestEntity);
      
              HttpClient httpClient = new HttpClient();
              int ret = httpClient.executeMethod(postMethod);
              String rpsContent = postMethod.getResponseBodyAsString();
              if (ret == 200) {
                  System.out.println(rpsContent);
              } else {
                  System.out.println("callApi failed: ret =" + ret + " rsp=" + rpsContent);
              }
          }
      

      使用預置曲目輸入歌詞:

      /**
           * 調用創建異步任務接口
           * @throws Exception IO異常
           */
          private static void creatAsyncTask() throws Exception {
              
              // 設置請求header
              PostMethod postMethod = new PostMethod(requestUrl);
              // 設置文本類型(String),例:"application/json;charset=utf-8"
              postMethod.setRequestHeader("Content-Type", contentType);
              // 設置請求ID(String),例:"9af1aeda-531b-407a-80b4-65b40ef77bd6"
              postMethod.setRequestHeader("X-Request-ID", requestId);
              // 設置App包名(String),例:"com.huawei.demo"
              postMethod.setRequestHeader("X-Package-Name", pacageName);
              // 設置App所在國家(String),例:"cn"
              postMethod.setRequestHeader("X-Country-Code", countryCode);
              // 設置App標識(String),例:"9af1aeda-531b-407a-80b4-65b40ef77bd6"
              postMethod.setRequestHeader("HMS-APPLICATION-ID", applicationId);
              // 設置證書指紋(String),例:"xxxxxxxxxxxxxxx"
              postMethod.setRequestHeader("certFingerprint", certFingerprint);
              // 設置動態獲取的AccessToken(String)
              postMethod.setRequestHeader("Authorization","Bearer " + accessToken);
              // 設置請求body
              Map<String, Object> bodyMap = new HashMap<>();
              Map<String, Object> dataMap = new HashMap<>();
              Map<String, Object> configMap = new HashMap<>();
              String[] lyrics = {"跟隨心跳的節拍", "感受自由的暢快", "把煩惱通通拋開", "我們一起嗨", "調整呼吸的節拍", "保持最好的狀態", "奔向耀眼的未來", "哦康忙北北"};
              dataMap.put("lyrics", lyrics);
              dataMap.put("accompanimentId", "1");
              dataMap.put("isAutoFill", "false");
              dataMap.put("language", "chinese");
              configMap.put("type", 1);
              configMap.put("outputEncoderFormat", 0);
              configMap.put("wordDurationForceAlign", "false");
              bodyMap.put("data", dataMap);
              bodyMap.put("config", configMap);
              RequestEntity requestEntity = new StringRequestEntity(JSONObject.toJSONString(bodyMap),"application/json" ,"UTF-8");
              postMethod.setRequestEntity(requestEntity);
      
              HttpClient httpClient = new HttpClient();
              int ret = httpClient.executeMethod(postMethod);
              String rpsContent = postMethod.getResponseBodyAsString();
              if (ret == 200) {
                  System.out.println(rpsContent);
              } else {
                  System.out.println("callApi failed: ret =" + ret + " rsp=" + rpsContent);
              }
          }
      

      注意:

      上述代碼中xxxxx對應的值請根據實際情況填寫,具體取值請參見創建異步任務

      2.2.2查詢異步任務狀態

      用戶創建異步任務后,可以通過調用該接口,獲取任務處理狀態等信息。任務處理完成后,會返回任務的下載地址,直接訪問該地址即可下載文件。

      通過access_token信息,和創建異步任務獲取到的taskId發送HTTPS POST查詢歌聲合成異步任務狀態。

      示例代碼(Java)如下所示:

      其中requestUrl = "https://audioeditor-api-drcn.cloud.huawei.com/v1/audioeditor/gateway/ai/ttsing/async/task/status"。

        /**
           * 調用查詢異步任務狀態接口
           * @param taskId 創建異步任務獲取的taskId
           * @throws Exception IO異常
           */
          private static void queryAsyncTaskInfo(String taskId) throws Exception {
              
              // 設置請求header
              PostMethod postMethod = new PostMethod(requestUrl);
              // 設置文本類型(String),例:"application/json;charset=utf-8"
              postMethod.setRequestHeader("Content-Type", contentType);
              // 設置請求ID(String),例:"9af1aeda-531b-407a-80b4-65b40ef77bd6"
              postMethod.setRequestHeader("X-Request-ID", requestId);
              // 設置App包名(String),例:"com.huawei.demo"
              postMethod.setRequestHeader("X-Package-Name", pacageName);
              // 設置App所在國家(String),例:"cn"
              postMethod.setRequestHeader("X-Country-Code", countryCode);
              // 設置App標識(String),例:"9af1aeda-531b-407a-80b4-65b40ef77bd6"
              postMethod.setRequestHeader("HMS-APPLICATION-ID", applicationId);
              // 設置證書指紋(String),例:"xxxxxxxxxxxxxxx"
              postMethod.setRequestHeader("certFingerprint", certFingerprint);
              // 設置動態獲取的AccessToken(String)
              postMethod.setRequestHeader("Authorization","Bearer " + accessToken);
              // 設置請求body
              Map<String, Object> bodyMap = new HashMap<>();
              // taskId對應的值是創建異步任務時返回的任務ID(taskId)
              bodyMap.put("taskId", taskId);
              RequestEntity requestEntity = new StringRequestEntity(JSONObject.toJSONString(bodyMap),"application/json" ,"UTF-8");
              postMethod.setRequestEntity(requestEntity);
      
              HttpClient httpClient = new HttpClient();
              int ret = httpClient.executeMethod(postMethod);
              String rpsContent = postMethod.getResponseBodyAsString();
              if (ret == 200) {
                  System.out.println(rpsContent);
              } else {
                  System.out.println("callApi failed: ret =" + ret + " rsp=" + rpsContent);
              }
          }
      

      注意:

      上述代碼中xxxxx對應的值請根據實際情況填寫,具體取值請參見查詢異步任務狀態

      2.2.3取消異步任務

      用戶創建歌聲合成異步任務后,可以通過調用此接口,取消指定異步任務并刪除相應任務數據。

      通過access_token信息和創建異步任務獲取到的taskId,發送HTTPS POST取消異步任務。

      示例代碼(Java)如下所示:

      其中requestUrl = "https://audioeditor-api-drcn.cloud.huawei.com/v1/audioeditor/gateway/ai/ttsing/async/task/cancel"。

        /**
           * 調用取消異步任務接口
           * @param taskId 創建異步任務獲取的taskId
           * @throws Exception IO異常
           */
          private static void cancelAsyncTask(String taskId) throws Exception {
              
              // 設置請求header
              PostMethod postMethod = new PostMethod(requestUrl);
              // 設置文本類型(String),例:"application/json;charset=utf-8"
              postMethod.setRequestHeader("Content-Type", contentType);
              // 設置請求ID(String),例:"9af1aeda-531b-407a-80b4-65b40ef77bd6"
              postMethod.setRequestHeader("X-Request-ID", requestId);
              // 設置App包名(String),例:"com.huawei.demo"
              postMethod.setRequestHeader("X-Package-Name", pacageName);
              // 設置App所在國家(String),例:"cn"
              postMethod.setRequestHeader("X-Country-Code", countryCode);
              // 設置App標識(String),例:"9af1aeda-531b-407a-80b4-65b40ef77bd6"
              postMethod.setRequestHeader("HMS-APPLICATION-ID", applicationId);
              // 設置證書指紋(String),例:"xxxxxxxxxxxxxxx"
              postMethod.setRequestHeader("certFingerprint", certFingerprint);
              // 設置動態獲取的AccessToken(String)
              postMethod.setRequestHeader("Authorization","Bearer " + accessToken);
              // 設置請求body
              Map<String, Object> bodyMap = new HashMap<>();
              // taskId對應的值是創建異步任務時返回的任務ID(taskId)
              bodyMap.put("taskId", taskId);
              RequestEntity requestEntity = new StringRequestEntity(JSONObject.toJSONString(bodyMap),"application/json" ,"UTF-8");
              postMethod.setRequestEntity(requestEntity);
      
              HttpClient httpClient = new HttpClient();
              int ret = httpClient.executeMethod(postMethod);
              String rpsContent = postMethod.getResponseBodyAsString();
              if (ret == 200) {
                  System.out.println(rpsContent);
              } else {
                  System.out.println("callApi failed: ret =" + ret + " rsp=" + rpsContent);
              }
          }
      

      注意:

      上述代碼中xxxxx對應的值請根據實際情況填寫,具體取值請參見取消異步任務

      除了歌聲合成能力,音頻編輯服務還提供音頻基礎剪輯、AI配音、音源分離、空間渲染、變聲降噪等音頻處理能力,更多信息可以訪問官網獲得

      了解更多詳情>>

      訪問華為開發者聯盟官網
      獲取開發指導文檔
      華為移動服務開源倉庫地址:GitHubGitee

      關注我們,第一時間了解 HMS Core 最新技術資訊~

      posted @ 2022-11-23 15:32  HarmonyOS_SDK  閱讀(648)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 国产午夜福利视频合集| 国产一区二区三区免费观看| 国产免费无遮挡吃奶视频| 无码人妻丰满熟妇区五十路在线| 亚洲精品一区二区制服| 久久天堂综合亚洲伊人HD妓女 | 成码无人AV片在线电影网站| 国产免费无遮挡吃奶视频| 国产免费视频一区二区| 中文成人无字幕乱码精品区| 日产国产一区二区不卡| 四虎影院176| 国产精品黄色片在线观看| 尤物yw193无码点击进入| 男女猛烈激情xx00免费视频| 精品久久久久无码| 亚洲综合国产伊人五月婷| 色偷偷www.8888在线观看| 久久婷婷五月综合色和啪| 黄色一级片一区二区三区| 国产精品无遮挡猛进猛出| 少妇人妻偷人精品无码视频新浪| 国产精品自拍视频免费看| 亚洲高清aⅴ日本欧美视频| 国产精品永久久久久久久久久| 亚洲精品香蕉一区二区| 成人网站免费观看永久视频下载| 亚洲码国产精品高潮在线| 精品无码国产自产拍在线观看蜜 | 亚洲跨种族黑人xxxxx| 九九热视频在线精品18| 国产AV福利第一精品| 国产精品熟妇视频国产偷人| 国产精品久久久久aaaa| 成人免费无码av| 欧美老人巨大XXXX做受视频| 国产精品二区中文字幕| 伊人精品成人久久综合97| 丰满人妻熟妇乱精品视频| 国内精品久久久久影视| 国产三级精品三级|