凤希AI - 音频管理器 - 音频加载
The audio loader that plays nice with ComfyUI loops
- 音频
- 采样率
- 当前音频路径
- 总音频数量
FxAiLoadAudioByIndex (凤希AI - 音频管理器 - 音频加载) is the part of the fxai-toolkit audio manager that makes "one node, many audio files" workflows possible. Instead of hard-wiring a single file into your graph, you give it a folder and an index and it loads whatever audio is at that position - then hands you the total count and the current path so you can loop over the whole batch without touching the graph. For multi-shot or multi-segment video work, that's the difference between copying the same node twenty times and writing a loop once.
Mechanically it's simple and predictable. It scans the folder, filters to audio extensions (.wav, .mp3, .flac, .ogg, .m4a, .aac, .wma, .ac3), sorts by filename so the order is stable, and picks 音频索引 % total. Out of range? No crash - you get a one-second silent waveform, sample rate 44100, and the path string 索引越界-无音频, which is a polite way of saying "this index has no audio yet." That's a genuinely thoughtful behavior for batch generation where a run might produce fewer segments than the loop expects.
The inputs that matter:
音频文件夹路径- the folder to scan. Point it at your clips, not a file.音频索引- which file to load, starting at 0.起始秒数and截取时长秒数(optional) - trim the loaded audio. Duration0means "to the end."
Outputs: 音频 (AUDIO) for your sampler or mux, 采样率 (INT), 当前音频路径 (STRING), and 总音频数量 (INT). The path and count are the interesting ones - wire 总音频数量 into a loop bound and 当前音频路径 into a filename node and you've got a self-driving batch pipeline.
Install is the standard fxai-toolkit story: ComfyUI Manager, search "fxai-toolkit", or cd ComfyUI/custom_nodes && git clone https://github.com/fxai666/fxai-toolkit and restart. The pack pulls in soundfile and psutil automatically and relies on FFmpeg being on PATH for the audio-heavy paths, so make sure it is. And yes, the labels are all Chinese - the pack is built by 凤希AI for a Chinese-speaking audience (help lives in QQ group 775649071 and on Bilibili), so expect to recognize the node by icon and menu position more than by reading it.
Where people get burned: relative paths. The folder path is interpreted as-is from where ComfyUI runs, so a bare folder name may resolve somewhere you didn't intend - use an absolute path or a path you can see resolving in the output. And if you trim with 截取时长秒数, remember the trim happens after the index pick, so a short file plus a long requested duration just clamps to the file's actual length. It's a loader, not a miracle worker.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| 音频文件夹路径 | STRING | — | |
| 音频索引 | INT | 0 | — |
| 起始秒数opt | FLOAT | 0.000 | — |
| 截取时长秒数opt | FLOAT | 0.000 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| 音频 | AUDIO | — |
| 采样率 | INT | — |
| 当前音频路径 | STRING | — |
| 总音频数量 | INT | — |