[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
one file per hour
- To: listener@vanheusden.com
- Subject: one file per hour
- From: mark@antistatic.org
- Date: Wed, 01 Mar 2006 17:33:00 -0800
- Delivered-to: listener@vanheusden.com
- User-agent: Internet Messaging Program (IMP) H3 (4.0.4) / FreeBSD-5.3
I recently stumbled upon Listener while looking for a way to record
scanner audio on my Linux box. Currently I am using XCorder Lite on
Windows.
Listener is nice, but I am wondering if anyone know of a way to use
only one file per hour (XCorder has this option and it has been very
useful to me).
From what I understand, the libsndfile API does not have the option of
"appending" WAV data to an existing file, which is why listener makes
lots of little files.
I have thought up a number of possibilities:
1) the cheap workaround: a utility that reads and combines all *.wav
files per hour into one file. this can be done possibly with the
"external script" option. anyone got one of these?
2) the impractical solution: wait for libsndfile to allow appending
3) the dangerous solution: re-open the file for that hour, pipe it into
a new temp file, add the current sound data, close the temp file,
rename the temp file for that hour. this could be dangerous because it
uses a lot of cpu/memory.
4) the practical, but time consuming, solution: re-write parts of
listener so that only one file per hour is open, then when there is
data, write to it.
when the hour changes, close the file and open a new one.
(so basically, when there is silence, we dont close the file. when
there is no silence, we dont open a new file, we just write.)
problems: if listener is killed we need to make sure to close the file
properly, otherwise it may not be playable or we may lose the data
altogether.
memory usage - in theory, we could use the full 60 minutes of audio.
I know #4 is probably not going to be done by the original writer
because it changes a lot of stuff already worked into the program, so I
may fiddle with it myself.
Anyone got any other ideas?
-Mark