Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am using Vorbis/ogg to record audio (using arecord and then pipping to oggenc). I have downloaded oggvideotools, which gave me oggCat, which will let me join two previously recorded audio files into one file. But, my problem is this:

The device I am working on is known to have the "plug pulled", but it is recording while the power is on (swapping out batteries etc.). Once the device is powered back on, I need to continue to record to the previous file (automated recording).

Right now, I can use arecord to record two separate files, and then once the recording is done, I can oggCat the two, but that doesn't get me what I want 100%, I need to be able to continue recording where the first file got cut off.

I originally put this on Stackoverflow, trying to solicit a python response, but it was closed by moderators - I hope this is a better place for it. I need python and busybox solutions. Unfortunately, other solutions outside Python and Busybox are not available to me - furthermore, downloading additional packages/programs is also not available, I have oggenc, arecord, and oggvideotools.

Any advise on where to look? Can I somehow pipe arecord data from a temp file to oggCat? Like:

oggCat NewFile.ogg File1.ogg (arecord file2.ogg ...)

Where "(arecord file2.ogg ...) is the file currently being recorded and simultaneously being appended to Newfile.ogg?

Thanks in advance,

(P.S. the audio files will have the exact same parameters - i.e. same channels, rates, etc)

share|improve this question

1 Answer 1

I haven't tested it but consider using process substitution. This will take the standard output of one program and provide it to another program via a pipe.

oggCat NewFile.ogg File1.ogg <(arecord)

If I am correct this would append the new recording to audio.ogg. The biggest problem I see is that arecord appears outputs to output a wav by default so you may need to encode it as an ogg.

Sorry, I don't have a mic to test it out. But I answered anyway because I felt that this is the bit you were looking for and can figure the rest out yourself.

share|improve this answer
    
Busybox ash does not support this syntax, as far as I know. –  Chris Down Oct 1 '13 at 3:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.