<div dir="ltr">Is this the right forum to ask these type of question?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 8, 2014 at 1:50 AM, Ibrar Ahmed <span dir="ltr"><<a href="mailto:ibrar.ahmad@gmail.com" target="_blank">ibrar.ahmad@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.804800033569336px">
I am writing a program to play audio using 'libpulse' on linux. I have successfully played the <code style="margin:0px;padding:1px 5px;border:0px;vertical-align:baseline;background-color:rgb(238,238,238);font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;white-space:pre-wrap">audio</code>, but need to know how to change the volume. I am able to start the stream using</p>
<pre style="margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:14px;vertical-align:baseline;background-color:rgb(238,238,238);font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;overflow:auto;width:auto;max-height:600px;word-wrap:normal;color:rgb(0,0,0);line-height:17.804800033569336px">
<code style="margin:0px;padding:0px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;white-space:inherit"><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">v </span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">=</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> PA_VOLUME_NORM</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">;</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">
pa_cvolume_set</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">(&</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">m_lcvolume</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">,</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> </span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent;color:rgb(128,0,0)">1</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">,</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> v</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">);</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">
pa_stream_connect_playback</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">(</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">s</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">,</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> NULL</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">,</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> </span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">&</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">attr</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">,</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> PA_STREAM_NOFLAGS</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">,</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> </span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">&</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">m_lcvolume</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">,</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent"> NULL</span><span style="margin:0px;padding:0px;border:0px;vertical-align:baseline;background-color:transparent">)</span></code></pre>
<p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;color:rgb(0,0,0);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.804800033569336px">
with pacific volume but need to know how to change the volume after connecting to stream. I don't want to call pa_stream_connect_playback function again and again to change the volume.</p><span class="HOEnZb"><font color="#888888"><div>
<br></div>-- <br>Ibrar Ahmed<div>
<br></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Ibrar Ahmed<div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">EnterpriseDB <a href="http://www.enterprisedb.com/" style="color:rgb(17,85,204)" target="_blank">http://www.enterprisedb.com</a></span><br>
<br></div>
</div>