Hi Gian,<br><br>For muting you could use<br><br>pa_context_set_sink_mute_by_index ?<br><br>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<br>
<br>one sink_info* s (passed in)<br><br> pa_volume_t new_volume = pa_sw_volume_from_linear(linear_input); <br> pa_cvolume dev_vol;<br> pa_cvolume_set(&dev_vol, s->volume.channels, new_volume); <br> pa_operation_unref(pa_context_set_sink_volume_by_index(pulse_context, s->index, &dev_vol, NULL, NULL));<br>
<br>The docs on the wiki are pretty comprehensive about this. <br><br>Conor<br><br>On Tue, Feb 9, 2010 at 9:39 AM, Gian Lorenzo Meocci <span dir="ltr"><<a href="mailto:glmeocci@gmail.com">glmeocci@gmail.com</a>></span> wrote:<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi all,<br>
<br>
<br>
I have soume problem to control audio volume.<br>
I am using:<br>
<br>
pa_cvolume a;<br>
a.channels = channels;<br>
a.values[0] = PA_VOLUME_MUTED;<br>
a.values[1] = PA_VOLUME_MUTED;<br>
<br>
if(pa_cvolume_valid(&a))<br>
qDebug() << "VALID";<br>
pa_cvolume_mute(&a, channels);<br>
<br>
<br>
but volume remain set NORMAL why???<br>
<font color="#888888"><br>
<br>
--<br>
Ing. Gian Lorenzo Meocci<br>
<a href="http://www.meocci.it" target="_blank">http://www.meocci.it</a><br>
_______________________________________________<br>
pulseaudio-discuss mailing list<br>
<a href="mailto:pulseaudio-discuss@mail.0pointer.de">pulseaudio-discuss@mail.0pointer.de</a><br>
<a href="https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss" target="_blank">https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss</a><br>
</font></blockquote></div><br>