Skip to content

pkgs/audio/portaudio

提供 native PortAudio capture/playback backend,并把设备 stream 适配为 pcm formats 和 writers。

Go API References

核心结构与主函数

符号作用
Driver / NewDriver管理 PortAudio backend lifecycle。
DeviceInfo描述 capture/playback device。
StreamConfig / StreamConfigFromPCM配置 device、format 与 frames per buffer。
CaptureStream / OpenCapture打开 audio input。
PlaybackStream / OpenPlayback打开 audio output。
PCMPlaybackWriter / OpenPCMPlaybackWriter将 PCM chunks 写入 playback stream。
ListDevices / DefaultInputDevice / DefaultOutputDevice查询设备。
NativeRuntimeSupported / BackendName描述当前平台 backend availability。

平台和 CGO support 由 backend matrix 决定;unsupported build 必须返回明确能力状态或错误。