How to change the volume in PulseAudio (libpulse)

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

 



Le 2014-05-07 23:50, Ibrar Ahmed a ?crit?:
> I am writing a program to play audio using libpulse on linux. I have
> successfully played the?audio, but need to know how to change the
> volume. I am able to start the stream using
>
> v = PA_VOLUME_NORM;
> pa_cvolume_set(&m_lcvolume, 1, v);
> pa_stream_connect_playback(s, NULL, &attr, PA_STREAM_NOFLAGS,
> &m_lcvolume, NULL)

You should not force the volume to a hard coded value at start. That 
will mess up the system mixer, especially unless flat volumes are 
disabled.

Only pass a volume to pa_stream_connect_playback() based on direct user 
input.

-- 
R?mi Denis-Courmont


[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux