how can i use alsa-lib api to control pcm playback volume.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user

[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux