alsa

Tutorials for OpenSL ES for Android

孤街醉人 提交于 2019-11-28 14:41:44
问题 I've been trying to look into using the OpenSL ES library that is available for doing native audio with android 2.3, but it appears that the header files and the 600 page pdf of the spec are the only available documentation. Where should I be looking for examples, tutorials, or a brief overview of the capabilities? 回答1: There's an example app that comes with the NDK called NativeAudio. It has examples of nearly anything you would ever want to implement: effects, streaming, synthesis, etc. If

Need a simple example for audio recording

跟風遠走 提交于 2019-11-27 13:12:42
问题 I am in need of simple audio recording and playing example using AudioRecorder in android. I tried with MediaRecorder, it works fine. 回答1: You mean AudioRecord ? Search e.g. "AudioRecord.OnRecordPositionUpdateListener" using Google Code Search. Btw, AudioRecord does recording, not playing. See also: Improve Android Audio Recording quality? Android AudioRecord class - process live mic audio quickly, set up callback function 回答2: here is the sample code for audio record. private Runnable

Android OpenAL?

做~自己de王妃 提交于 2019-11-27 11:28:35
Has anyone built OpenAL for the Android, or found the shared library for it on the system? This seems like an obvious need for a game of any kind, yet there's no resources out there for it. It seems the Android java sound library can't do pitch changes from what I can tell, so there seems a need for OpenAL. I know OpenAL Soft can be built on top of ALSA, but I'm not sure if anyones done that, and I'm sure it would take me a month. If there's a good guide somewhere on sound manipulation on the Android without OpenAL, that's fine too. It's just that OpenAL is sort of a standard for game makers

The meaning of period in ALSA

浪尽此生 提交于 2019-11-27 10:10:28
问题 I'm using ALSA for and audio application on Linux, I found great docs explain how to use it : 1 and this one. although I have some issues to understand this part of the setup : /* Set number of periods. Periods used to be called fragments. */ if (snd_pcm_hw_params_set_periods(pcm_handle, hwparams, periods, 0) < 0) { fprintf(stderr, "Error setting periods.\n"); return(-1); } what does mean set a number of period when I'm using the PLAYBACK mode and : /* Set buffer size (in frames). The

Inject uplink audio in call with Snapdragon MSM8960 SoC

↘锁芯ラ 提交于 2019-11-27 07:31:16
I've been investigating on this topic specific to MSM8960 for some time. I looked into the ALSA hardware module from google . Michael's answer in the post did mention that MSM8960 supported the in-call uplink audio injection at "Hardware and Device Driver" level. Did it refer to the level at this ALSA module? From the ALSA config file on the phone, it seems the in call voice playback is done through /dev/snd/pcmC0D0p , or at least comply with the ALSA paradigm. Is it possible to play with one of the file descriptor to achieve the purpose? I do see some interesting USE_CASE definition in

How to play sound in a docker container

☆樱花仙子☆ 提交于 2019-11-27 01:58:13
问题 I'm trying to dockerize a text to speech application for sharing the code with other developers, however the issue I am having right now is the docker container cannot find the sound card on my host machine. When I try to play a wav file in my docker container 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

Set ALSA master volume from C code

≡放荡痞女 提交于 2019-11-26 22:06:21
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. 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; snd_mixer_selem_id_t *sid; const char *card = "default"; const char *selem_name = "Master"; snd_mixer_open(

Redirecting audio / creating alternate sound paths in Android

大憨熊 提交于 2019-11-26 19:37:23
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 done within the radio. Any ideas on where to begin? I've done some research with OpenSL and ALSA, but it

Android OpenAL?

拥有回忆 提交于 2019-11-26 18:01:52
问题 Has anyone built OpenAL for the Android, or found the shared library for it on the system? This seems like an obvious need for a game of any kind, yet there's no resources out there for it. It seems the Android java sound library can't do pitch changes from what I can tell, so there seems a need for OpenAL. I know OpenAL Soft can be built on top of ALSA, but I'm not sure if anyones done that, and I'm sure it would take me a month. If there's a good guide somewhere on sound manipulation on the

Inject uplink audio in call with Snapdragon MSM8960 SoC

风格不统一 提交于 2019-11-26 13:20:59
问题 I've been investigating on this topic specific to MSM8960 for some time. I looked into the ALSA hardware module from google. Michael's answer in the post did mention that MSM8960 supported the in-call uplink audio injection at "Hardware and Device Driver" level. Did it refer to the level at this ALSA module? From the ALSA config file on the phone, it seems the in call voice playback is done through /dev/snd/pcmC0D0p , or at least comply with the ALSA paradigm. Is it possible to play with one