<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.12.1">
</HEAD>
<BODY>
I have a C program constructing a pipeline recording from the sound card to a file.&nbsp; I need to add a few features and am not sure of the best approach.&nbsp; The features are:<BR>
<BR>
1) Record from a device, connected to the sound card, that sometimes has a sound input but is mostly quiet, not unlike a microphone.&nbsp; I need to be able to detect the state transitions to and from quiet and stop and start recording when the events occur.&nbsp; This is to reduce the time needed to process the resulting files by another application later.&nbsp; I am unsure how to detect the quiet state transitions.<BR>
<BR>
2) The output will be placed into one of several files.&nbsp; The file to use will be determined when a sound is detected.&nbsp; I do not want to lose any signal at the beginning or end of the recording.&nbsp; In other words, the first sound may go to file foo, the second and third sounds to bar, and the fourth to foo.&nbsp; I am unsure of how to most optimally configure the pipeline for this type of dynamic operation.<BR>
<BR>
Any advice as to how to proceed would be appreciated.<BR>
<BR>
</BODY>
</HTML>