[Alsa-user] how can i use alsa-lib api to control pcm playback volume.
Brought to you by:
perex
From: Falcon.Xu <blu...@ho...> - 2008-08-31 14:10:46
|
Hi: i'm doing some develop on a linux system, kernel version: 2.6.23.9. alsa-lib version:1.0.15. now ffmpeg and alsa can work together to playback mp3/aac file. during this step: snd_pcm_open(&pcm_handle, "default", SND_PCM_STREAM_PLAYBACK, 0); set_params(); //set hw and sw params. while(audio_data) { decode_audio_data(&audio_data, &data_len); snd_pcm_writei(audio_data. data_len); } and the mp3 playback is ok, now i'm going to add the volume control functions when the sound is playback. but when i read the alsa-lib api funtions reference, i can not clearly know how i can control the pcm volume by alsa-lib functions. and in alsamixer and amixer functions, seems complex to complete the operation. is it has a simple way to control the pcm volume? thanks for any suggestions. |