Hello,<div>I have a small audio recorder that uses Gstreamer.  </div><div>I would like the recorder to pause when the signal-level drops under a certain value,  and re-start when the level rises again.</div><div><br></div>
<div>I cannot simply set the pipeline or filesink to GST_STATE_PAUSED or NULL because my code needs to check the level-value all the time (so it can determine when to stop or re-start writing to a sink file). </div><div>The pipeline must run all the time so the "message::element" message is generated and level_message_cb(...) is called continually.</div>
<div><br></div><div>How can I stop (and re-start) writing to a filesink, while the pipeline is ticking and alive?</div><div>I understand this can be difficult because container formats (like ogg) need to write bytes to previous blocks.</div>
<div><br></div><div>Here is my test-code, a small gtk-program:</div><div><div><a href="http://www.futuredesktop.org/tmp/test1.c">http://www.futuredesktop.org/tmp/test1.c</a></div><div><br></div><div>I have tried to stop/start the filesink with various methods. </div>
<div>Please see set_filesink1(...) and set_filesink2(...).</div><div><br></div><div>For example, I tried to set the filesink to READY-state, then setting its location to NULL, and later back to "test1.ogg" But this is not allowed.</div>
<div><br></div><div>Compile:</div><div><div>gcc -Wall test1.c -o test1 $(pkg-config --cflags --libs gtk+-3.0 gthread-2.0 gstreamer-0.10)</div><div><br></div><div>Run:</div><div>./test1</div></div><div><br></div></div><div>
The recorder is open source.</div><div><br></div><div>Kindly</div><div>Alexander</div>