李经理:15682290831

通用服务端
视频编辑SDK
K歌SDK

功能说明

通过音乐id下载某首音乐,视频编辑场景下优先推荐aac编码,请注意:禁止在服务端缓存音频数据

请求方法

GET

Header

以下请求参数列表仅列出了部分公共参数,完整公共参数列表见 公共参数列表

请求参数

请求示例

                HFClient client = new DefaultHFClient(url, appkey, secret);
HFKHQListenRequest request = new HFKHQListenRequest();
request.setMethod(HFRequest.METHOD_GET);
request.setClientId("hf2y7jk19a56qetq05");
request.setMusicId("B7B810AABADF");
request.setAudioFormat(AudioFormatEnum.MP3_128.format);
request.setAudioRate(AudioFormatEnum.MP3_128.rate);
try {
  HFKHQListenResponse response = client.execute(request);
  System.out.println(JSON.toJSON(response));
} catch (ApiException e) {
  e.printStackTrace();
}
              

响应数据

        curl - G https: //gateway-open.haifanwu.com -H 'Authorization:HF3-HMAC-SHA1 Signature=62BD26161CFC32573351A90A691DC23B' -H 'X-HF-ClientId:hf2y7jk19a56qetq05' -H 'X-HF-AppId:170ae316b9b14c1b9c185988771bde16' -H 'X-HF-Action:KHQListen' -H 'X-HF-Timestamp:1595827081147' -H 'X-HF-Version:V4.1.1' -H 'X-HF-Nonce:vbbVENnqVHonEEccjwAHJMXewzexrkLq' 
  -X GET - d 'MusicId=B7B810AABADF&AudioFormat=mp3&AudioRate=320'
  {
    "code": 10200,
    "msg": "操作成功",
    "data": {
      "fileUrl": "https://static-hifiveai-open.haifanwu.com/WaterMark/hifive/EM/XCD/mp3_320/EM_XCD_0383/EM_XCD_0383_007.mp3?sign=c99ca01ca4a8e49dab9a7ac24411c40f&t=1595827081",
      "expires": 1595827681732,
      "waveUrl": "https://static.hifive.open.haifanwu.com/wave/EM/XCD/EM_XCD_0383/EM_XCD_0383_007.json?sign=941195e31220d8fe1984fb06613a119c&t=1595827081",
      "musicId": "B7B810AABADF",
      "dynamicLyricUrl": "",
      "staticLyricUrl": "",
      "fileSize": 7339407
    },
    "taskId": "a8462476d9cb6db1ded1926142f5b7be"
  }
      
  • 功能说明
  • 请求方法
  • Header
  • 请求参数
  • 请求示例
  • 响应数据