设置 ALSA 流的音量

发布于 2024-09-30 09:30:28 字数 215 浏览 3 评论 0原文

我需要能够设置 ALSA 流的音量(来自 PCM 接口的 snd_pcm_t)。这是一个常见的操作,我不明白为什么没有简单的方法?我该怎么做?流衰减数据不是一个选项,因为这会导致音量调整不稳定,因为数据被缓冲。在 DirectSound 和 WinMM 中,这是一个简单的函数调用。我错过了什么吗?我应该使用混音器接口吗?控制接口?我发现 snd_pcm_t 和控制接口之间没有任何联系。我使用了错误的 API 吗?

I need to be able to set the volume of my ALSA stream (snd_pcm_t from the PCM Interface). This is a common operation and i don't understand why there is no easy way? How can i do this? Streaming attenuated data is not an option since this will cause choppy volume adjustments because data is buffered. In DirectSound and WinMM it's a simple function call. Have i missed something? Should i use the mixer interface? The control interface? I see no connection between snd_pcm_t and the control interface. Am i using the wrong API?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挽心 2024-10-07 09:30:28

我正在移植到 PulseAudio,似乎性能良好并且有更好的文档。

I am porting to PulseAudio instead, seems to be well performing and has better documentation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文