Tag: alsa

如何在Docker中使用alsa声音和/或snd_pcm_open?

我正在Ubuntu 16.04主机上运行Ubuntu 12.04 Docker容器。 一些testing代码我使用了SND_PCM_STREAM_PLAYBACK和SND_PCM_STREAM_CAPTUREstreamtypes的练习'snd_pcm_open'/'snd_pcm_close'操作。 我不需要任何实际的声音/audiofunction,只是得到'snd_pcm_open'返回一个有效的句柄,然后'snd_pcm_close'返回0在同一个句柄将足够我的目的。 我不想修改代码,因为它已经有一些不太好的平台相关开关,我不是维护者。 我正在使用简单的代码并将其编译为“g ++ alsa_test.cpp -lasound” #include <stdio.h> #include <alsa/asoundlib.h> int main() { snd_pcm_t* handle; snd_pcm_stream_t stream_type[]= {SND_PCM_STREAM_PLAYBACK, SND_PCM_STREAM_CAPTURE}; printf("\nstarting\n"); for (unsigned char i = 0; i < sizeof(stream_type) / sizeof(stream_type[0]); ++i) { printf(">>>>>>>>\n\n"); int deviceResult = snd_pcm_open(&handle, "default" , stream_type[i], 0); printf("\n%d open: %d\n", stream_type[i], deviceResult); if (deviceResult >= […]

在Docker容器中使用audio运行应用程序

这个问题的启发可以在docker容器中运行GUI应用程序吗? 。 基本的想法是运行audio和用户界面(VLC,火狐,Skype,…) 我正在使用pulseaudiosearchdocker容器,但是我发现使用pulseaudio streaming over tcp的所有容器。 (应用程序的安全沙箱) https://gist.github.com/hybris42/ce429de428e5af3a344a https://github.com/jlund/docker-chrome-pulseaudio https://github.com/tomparys/docker-skype-pulseaudio 在我的情况下,我会prefere播放audio从容器内的应用程序直接到我的主机pulseaudio。 (没有SSH隧道和臃肿的docker图像) Pulseaudio,因为我的qt应用程序正在使用它;)

如何在Docker中为debian创build声音设备?

我正在使用各种docker集装箱,在封面上build立在Debian sid上。 这些图像缺less/dev/snd和/dev/snd/seq ,这是非常有意义的,因为它们没有硬件声卡。 我用来生成MIDI文件的几个软件需要这些定序器设备。 它们不一定用于发送audio,但是如果声音设备不存在,代码本身就会在init中死掉。 要清楚的是,我不需要在docker中生成audio信号,而只是需要这些来让其他软件开心。 到目前为止,我所尝试的是无休止地安装各种alsa软件包( alsa-utils , alsa-oss等),并试图用我的方式来探索,所有这些都没有运气。 在docker集装箱内,即使虚设了什么也需要有效的audio设备?

如何在docker集装箱中播放声音

我试图dockerize文本到语音应用程序与其他开发人员共享代码,但是我现在遇到的问题是泊坞窗容器无法find我的主机上的声卡。 当我尝试在我的docker容器中播放一个wav文件时 root@3e9ef1e869ea:/# aplay Alesis-Fusion-Acoustic-Bass-C2.wav ALSA lib confmisc.c:768:(parse_card) cannot find card '0' ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: […]

在Docker容器中logging本地audio

如何使用ffmpeg在Docker容器中logging像Firefox这样的应用程序的audio? 我已经find了如何转发pulseaudio到主机 – netflix , Skype的例子。 当我尝试使用pactl时: pactl list sources 要么 docker exec -it <container-id> bash apt-get install pulseaudio pactl load-module module-native-protocol-unix auth-anonymous=1 socket=/tmp/.pulse-socket 我收到一个错误: Connection failure: Connection refused pa_context_connect() failed: Connection refused 这也失败了 ffmpeg -f pulse -i default /tmp/pulse.wav