alsa

Redirecting audio / creating alternate sound paths in Android

半世苍凉 提交于 2019-11-26 08:58:58
问题 Does anyone have experience (using OpenSL ES, ALSA, etc.) with redirecting audio or creating new sound paths in Android? The end goal is to create a virtual microphone to replace the external microphone, where one can play audio files as if they were speaking into the microphone. Applications accessing the microphone with AudioSource.MIC should use this alternate stream. It\'s not necessary for it to work with voice calls, I believe achieving that sort of functionality is harder as it\'s all

Set ALSA master volume from C code

戏子无情 提交于 2019-11-26 08:08:47
问题 I\'ve been looking for a simple C code example to set the master volume of the ALSA mixer but could not find anything simple for this supposedly common operation. I\'m totally unfamiliar with ALSA, so making my own minimal example will take time. I would be happy if anyone could provide one. 回答1: The following works for me. The parameter volume is to be given in the range [0, 100]. Beware, there is no error handling! void SetAlsaMasterVolume(long volume) { long min, max; snd_mixer_t *handle;

alsa总结

旧城冷巷雨未停 提交于 2019-11-26 02:41:24
alsa工具集 aplay,arecord 用于播放和录制音频等, 支持RAW PCM、WAVE、AU、VOC文件类型; 用于操作PCM接口。 查看声卡设备和PCM设备。 aplay -l arecord -l alsamixer,amixer alsamixer是Linux音频框架ALSA工具之一,用于配置音频各个参数; alsamixer是基于文本图形界面的,可以在终端中显示,通过键盘的上下键,左右键等实现音量设置,开关操作等。 amixer,是alsamixer的文本模式,即命令行模式,以命令行的形式去配置声卡的各个选项,比如选择音频输入通道是Mic输入,还是Line输入。 alsactl 控制ALSA声卡驱动的高级设置; 用于操作控制器(Control)接口。 查看alsa版本 alsactl -v 设备接口 在ALSA中, 声卡硬件对应于Card, ALSA可支持多达八个声卡. 声卡包含多个设备(Device), 设备从0开始标识; 设备(Device)有不同的类型(Type), 如播放(Playback)、录制(Capture)、控制器(control)、定时器(timer)、序列器(sequencer), 当没有指定设备时, 默认的设备号为0。 设备可能包含多个子设备(SubDevice), 子设备也是从0开始标识; 一个子设备代表了设备的声音通道(???some

PyAudio working, but spits out error messages each time

廉价感情. 提交于 2019-11-26 02:01:59
I'm using PyAudio to record input from the microphone. Since the audio is recording fine for me, should I try to simply suppress its error messages? Or would there be a way of resolving them? ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side ALSA lib audio/pcm_bluetooth.c:1613:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5) ALSA lib audio/pcm_bluetooth.c:1613:(audioservice_expect) BT_GET_CAPABILITIES