---
title: "获取歌曲音频流列表"
method: GET
path: "/songs/{id}/audio-tracks"
tags: ["歌曲管理"]
---

# 获取歌曲音频流列表

`GET /songs/{id}/audio-tracks`

用 ffprobe 探测该歌曲文件的音频流，返回每条流的 audio-relative index（对应 ffmpeg -map 0:a:N）、title、language、codec、default。主要用于 Web 端双音轨（原唱/伴奏 mka）切换：前端据 tracks 数量决定是否显示切轨入口，并用 index 调 /songs/{id}/play?track=N 抽轨播放。仅本地歌曲（或已落地缓存的网络歌曲）有文件可探测；无可探测文件或音频流 < 2 条时也正常返回（前端据此不显示切轨）。运行时按需探测，不落库。

## Path parameters

- `id` integer, required

## Response `200`

音频流列表

- HandlersAudioTracksResponse
  - `tracks` ServicesAudioTrackInfo[]
    - `codec` string
    - `default` boolean
    - `index` integer
    - `language` string
    - `title` string

## Other responses

- `400` — 无效的歌曲 ID
- `404` — 歌曲不存在

---

[API](https://skmtc.net/songloft-org/apis/songloft-api.md) · [All operations](https://skmtc.net/songloft-org/apis/songloft-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/songloft-org/songloft-api/revisions/7b27bea2ec09/schema)
