Hi<br><br><div class="gmail_quote">On Tue, Aug 9, 2011 at 11:18 PM, Johannes H. Jensen <span dir="ltr">&lt;<a href="mailto:joh@pseudoberries.com">joh@pseudoberries.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Tue, Aug 9, 2011 at 14:32, Maarten Bosmans &lt;<a href="mailto:mkbosmans@gmail.com">mkbosmans@gmail.com</a>&gt; wrote:<br>
&gt; That could indeed by some handy functionality.<br>
&gt; In pulseaudio there&#39;s already a concept of corking a stream. If a<br>
&gt; stream is corked, its audio is muted and the application receives a<br>
&gt; signal so it can pause the playback. If the stream is uncorked, the<br>
&gt; music resumes playing.<br>
<br>
</div>Ah, that&#39;s neat! Is there any way to cork a stream from command-line<br>
tools like pacmd?<br></blockquote><div><br>I guess not, but PA does post an event to the application to CORK/UNCORK the stream, its application responsibility to handle the event and behave accordingly. <br>e.g module-cork-music-on-phone , PA posts and event  using pa_sink_input_send_event(j, PA_STREAM_EVENT_REQUEST_CORK, NULL)<br>
to the application, application need to register for callback using &quot;pa_stream_set_event_callback&quot; to receive the events from PA.<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div class="im"><br>
&gt; This would indeed be best implemented as a module. You can use<br>
&gt; module-cork-music-on-phone as an example.<br>
&gt; There were also some threads on the mailing list about corking streams<br>
&gt; that you might want to read, such as &quot;dynamic routing through pulse<br>
&gt; audio&quot; a couple of weeks back.<br>
<br>
</div>Great, I will base my module on that :-)<br></blockquote><div><br>Sure, you will get enough hints if you go-through the module-cork-music-on-phone ,so its best to initially modify the existing module-cork-music-on-phone and base your module on this.<br>
 </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
Thanks!<br>
<font color="#888888"><br>
- Johannes<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
pulseaudio-discuss mailing list<br>
<a href="mailto:pulseaudio-discuss@lists.freedesktop.org">pulseaudio-discuss@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss" target="_blank">http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss</a><br>
</div></div></blockquote></div><br>