[pulseaudio-discuss] voulme control

Forwind info forward at forwind.net
Tue Feb 9 02:20:10 PST 2010


Hi Gian,

For muting you could use

pa_context_set_sink_mute_by_index ?

To control volume, you need to set the volume on a pa_cvolume and then set
the volume on the device with this struct. something like

one sink_info* s (passed in)

    pa_volume_t new_volume = pa_sw_volume_from_linear(linear_input);
    pa_cvolume dev_vol;
    pa_cvolume_set(&dev_vol, s->volume.channels, new_volume);
    pa_operation_unref(pa_context_set_sink_volume_by_index(pulse_context,
s->index, &dev_vol, NULL, NULL));

The docs on the wiki are pretty comprehensive about this.

Conor

On Tue, Feb 9, 2010 at 9:39 AM, Gian Lorenzo Meocci <glmeocci at gmail.com>wrote:

> Hi all,
>
>
> I have soume problem to control audio volume.
> I am using:
>
> pa_cvolume a;
> a.channels = channels;
> a.values[0] = PA_VOLUME_MUTED;
> a.values[1] = PA_VOLUME_MUTED;
>
> if(pa_cvolume_valid(&a))
>        qDebug() << "VALID";
> pa_cvolume_mute(&a, channels);
>
>
> but volume remain set NORMAL why???
>
>
> --
> Ing. Gian Lorenzo Meocci
> http://www.meocci.it
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at mail.0pointer.de
> https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20100209/66ea9721/attachment.htm>


More information about the pulseaudio-discuss mailing list