Audio Node
音频处理节点。
功能
- 音频录制
- 音频播放
- 语音识别
- 语音合成
配置
json
{
"audio": {
"inputDevice": "default",
"outputDevice": "default",
"sampleRate": 16000,
"channels": 1
}
}使用示例
typescript
// 录制音频
await audio.record({
duration: 5000,
output: 'recording.wav'
})
// 播放音频
await audio.play('recording.wav')
// 语音识别
const text = await audio.transcribe('recording.wav')支持的格式
| 格式 | 编码 | 支持 |
|---|---|---|
| WAV | PCM | ✅ |
| MP3 | MP3 | ✅ |
| OGG | Opus | ✅ |
| FLAC | FLAC | ⏳ |