Re: Recording specific channels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 

This one also. It looks so promising, if I could just get it to be stable.

 

To test, in one terminal window I started the recording.

 

minion-2-recording:~ minion$ ~/sox/rec -V5 -c 8 -b 16 -r 48k /Volumes/CAF3/test.aif

 

To test the splits, I opened another window and ran:

 

minion-2-recording:~ minion$ ~/sox/sox /Volumes/CAF3/test.aif /Volumes/CAF3/test1.aif remix 3 4 trim 0 30

minion-2-recording:~ minion$ ~/sox/sox /Volumes/CAF3/test.aif /Volumes/CAF3/test2.aif remix 3 4 trim 30 30

minion-2-recording:~ minion$ ~/sox/sox /Volumes/CAF3/test.aif /Volumes/CAF3/test3.aif remix 3 4 trim 60 30

 

Then combined these in an Amadeus Pro file and checked and it does exactly what we need. Then about 60 seconds after I ran these tests SoX stopped abruptly for no reason I can see.

 

minion-2-recording:~ minion$ ~/sox/rec -V5 -c 8 -b 16 -r 48k /Volumes/CAF3/test.aif

/Users/minion/sox/rec:      SoX v14.4.2

time:     Feb 22 2015 14:58:07

uname:    Darwin minion-2-recording 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul  5 22:17:35 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T8112 x86_64

compiler: gcc 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)

arch:     1288 48 88 L

/Users/minion/sox/rec DBUG coreaudio: audio device did not accept 2 channels. Use 18 channels instead.

/Users/minion/sox/rec DBUG coreaudio: audio device did not accept 44100 sample rate. Use 48000 instead.

/Users/minion/sox/rec WARN formats: can't set 8 channels; using 18

 

Input File     : 'default' (coreaudio)

Channels       : 18

Sample Rate    : 48000

Precision      : 32-bit

Sample Encoding: 32-bit Signed Integer PCM

Endian Type    : little

Reverse Nibbles: no

Reverse Bits   : no

 

/Users/minion/sox/rec DBUG aiff: converted 48000 to 100 16 37777777673 37777777600 0 0 0 0 0 0

 

Output File    : '/Volumes/CAF3/test.aif'

Channels       : 8

Sample Rate    : 48000

Precision      : 16-bit

Sample Encoding: 16-bit Signed Integer PCM

Endian Type    : big

Reverse Nibbles: no

Reverse Bits   : no

Comment        : 'Processed by SoX'

 

/Users/minion/sox/rec DBUG effects: sox_add_effect: extending effects table, new size = 8

/Users/minion/sox/rec DBUG remix: 0:

/Users/minion/sox/rec DBUG remix:    0 0.333333

/Users/minion/sox/rec DBUG remix:    8 0.333333

/Users/minion/sox/rec DBUG remix:    16 0.333333

/Users/minion/sox/rec DBUG remix: 1:

/Users/minion/sox/rec DBUG remix:    1 0.333333

/Users/minion/sox/rec DBUG remix:    9 0.333333

/Users/minion/sox/rec DBUG remix:    17 0.333333

/Users/minion/sox/rec DBUG remix: 2:

/Users/minion/sox/rec DBUG remix:    2 0.5

/Users/minion/sox/rec DBUG remix:    10 0.5

/Users/minion/sox/rec DBUG remix: 3:

/Users/minion/sox/rec DBUG remix:    3 0.5

/Users/minion/sox/rec DBUG remix:    11 0.5

/Users/minion/sox/rec DBUG remix: 4:

/Users/minion/sox/rec DBUG remix:    4 0.5

/Users/minion/sox/rec DBUG remix:    12 0.5

/Users/minion/sox/rec DBUG remix: 5:

/Users/minion/sox/rec DBUG remix:    5 0.5

/Users/minion/sox/rec DBUG remix:    13 0.5

/Users/minion/sox/rec DBUG remix: 6:

/Users/minion/sox/rec DBUG remix:    6 0.5

/Users/minion/sox/rec DBUG remix:    14 0.5

/Users/minion/sox/rec DBUG remix: 7:

/Users/minion/sox/rec DBUG remix:    7 0.5

/Users/minion/sox/rec DBUG remix:    15 0.5

/Users/minion/sox/rec INFO sox: effects chain: input        48000Hz 18 channels (multi) 32 bits unknown length

/Users/minion/sox/rec INFO sox: effects chain: channels     48000Hz  8 channels (multi) 32 bits unknown length

/Users/minion/sox/rec INFO sox: effects chain: dither       48000Hz  8 channels         16 bits unknown length

/Users/minion/sox/rec INFO sox: effects chain: output       48000Hz  8 channels (multi) 16 bits unknown length

/Users/minion/sox/rec DBUG sox: start-up time = 0.039881

In:0.00% 00:15:24.63 [00:00:00.00] Out:44.4M [      |      ]        Clip:0   

Done.

/Users/minion/sox/rec DBUG aiff: converted 48000 to 100 16 37777777673 37777777600 0 0 0 0 0 0

minion-2-recording:~ minion$

 

5/13/24, 01:14, "Jan Stary" <hans@xxxxxxxx>:

 

On May 12 21:23:34, D.Cottle@xxxxxxxx wrote:
> We use Logic to record the CAF files. It’s an option in preferences.
>
> We restart logic with a macro that very quickly presses space (stop), return (return to beginning), R (start recording). Logic starts a new batch of stereo pair CAF files and we split, then move the older ones.

OK, but who runs that macro and when?

> [Is that a limitation… ]
> that was the first thing we checked

> >From Wikipedia, hundreds of years: “.caf container can contain many different audio formats, metadata tracks, and much more data. Like the RF64<https://en.wikipedia.org/wiki/RF64>, it is not limited to a 4 GB<https://en.wikipedia.org/wiki/Gigabyte> file size and a single .caf file can theoretically save hundreds of years of recorded audio due to its use of 64-bit file offsets.”
> That’s why we use it rather than AIF or WAV.

Thanks, I didn't know CAF had _less_ limitations in this regard.

> We let Logic run about 10 hours, then reset it using the macro.

Meaning, there is a person taking care of the 10h mark
and running the macro manualy? Or is the macro run
automaticaly at a specified time?

My point is, if there is an audio engineer pressing record (in effect)
anyway, just let the guy press record when the band begins to play
and press stop when the concert is over. Like in the old days :-)

> [You would be better off… ]
>
> EXACTLY! That’s what I’m trying to do. I’m partway there,
> but I’m not going to rely on it if it stops after 20 seconds.
>
> [0 * * * * $... ]
>
> I tried this and the trim didn’t have any affect I could see.
> It simply recorded and continued recording.

Sorry, wrong syntax: should be "trim 0 $length".
(What I wrote starts recording _after_ 3600 seconds.)

> If I could get sox to record 4 stereo files split at the hour
> and not stop after 20 seconds I’d switch tomorrow.
> Something like three terminal windows, each with a command:

No, not three terminals. If you want to automatize,
but it in a crontab, so that it starts and stops by itself.

> splits the file at the sample level but also ***starts a new file
> without killing the old one.

The "newfile" pseudoeffect (see manpage)
seems to be exactly what you want.

> Because we don’t know when there will be someone in a room practicing, doing a session (they’ve come to rely on this system), or recording video with a phone then they pull our higher quality audio to sync it. We’ve been doing this for 15 years and it’s revolutionized how students and faculty work. They can get a recording of anything they do anytime. Some students just see an empty room or hall, walk in, play for a half hour and request the recordings. Organists practice at 6am. If they nail a Bach, they have a recording. (Or maybe they just want to listen to how it sounded with the acoustic curtains up or down.) FWIW, we’ve won a few awards. And we NEVER miss a concert. Even if it was changed to a different room or time at the last minute.

For an audio guy, this seems like a great place to work at.

> I need it to do 8 stereo pairs to separate files on two Mac Minis
> but most important, split the files at the sample level, no gaps.
> I’m not sure command lines can be that precise.

What exactly do you mean by "splitting at the sample level"?
Obviously, one sample will be the last wherever you cut,
but that's probably not what you mean.

You can also tell SoX after how many _samples_ you want to trim,
but that would rely on the specific sample rate of course.

> [rec -V5…]
>
> Looks like buffer overrun. This stopped after 25 seconds.
> minion-2-recording:~ minion$ ~/sox/rec -c 8 -b 16 -r 48k /Volumes/CAF3/test.caf

Please show the full output of the rec -V5 ... run,
which this is not.


        Jan



> 5/12/24, 14:02, "Jan Stary" <hans@xxxxxxxx>:
>
> On May 12 18:49:57, D.Cottle@xxxxxxxx wrote:
> > I pretty much got it to work, but new question: SoX stops on its own. I can’t see any reason. This has happened when recording from the interface to my laptop, from my internal speaker on laptop, and on our Mac Minis at school. After about 30 minutes of recording 8 channels to a single file, it simply stops and returns “done.” Why would this happen?
>
> What exactly is the sox command line?
> Is there enough space where you are writing?
>
> > Yes, I split the .CAF files with a script (AppleScript that sends
> > a shell script with sox) every hour to aif.
>
> Hwo exactly are you recording the CAF files in the first place?
> How are you restarting this CAF recording? Surely you don't record
> one endless file.
>
> How exactly are you splitting the caf files to the aif files?
>
> > We then save the .CAF files just in case for a few days.
> > Our staff works with the aif files and hardly ever deals with the .CAF.
> > The odd limitation is that Logic can only record about 13 hours.
> > I don’t know why there is this limitation where CAFs can run for days,
> > if I understand correctly.
>
> Is that a limitaion of Logic for sure?
> Could that be a limitation of the CAF format?
> (BTW, why are you uisng CAF?)
>
> > We reset Logic once every day
> > (with scripts, and lose about 400 ms).
>
> How do you records 24/7 then,
> if the recording stops after 13 hours?
>
> You would imho be better off recording with sox directly,
> putting something like
>
> 0 * * * * $PATH/rec -c 8 /some/where/$DATE-HOUR.caf trim 3600
>
> in your crontab and leave the Logic Pro scripting out of it.
>
> > We also record silence but then use sox to analyze the hour blocks
> and throw away silent hours. This is slightly inefficient, since there
> might only be 3 minutes of usable material in an otherwise silent file.
>
> So why are you recording everything all the time?
>
> > Before Logic we used Audio Companion, which allows you to turn
> > the recording on and off based on silence,
>
> sox can do that to.
> but then a long pause in a compostion might fool the recording.
>
> > The Logic method allows exact time frames.
>
> Is some timestamp stored in the CAF file?
>
> > It could be that SoX will do everything we need. That’s why I’m investigating it. We know Logic. It gives us meters for every room, with peak indicators, which we can check visually or remotely using screen share.
>
> You mean, there is a human operator overseeing the recording?
> What is the point in automatizing the one recording command?
>
> > It has an input monitor so we can listen to each room individually.
> > Most important I can pick and choose what input streams it records
> > and it outputs individual stereo tracks.
>
> You said you record all the rooms 24/7 ...
>
> > Mostly my staff understands Logic and while SoX might allow similar functionality, I don’t understand it as well, and we know Logic.
>
> The biggest advantage os using sox for this, imho,
> is that it's a commandline tool, trivialy scriptable;
> recording one hour, saving it in a file appropriately named,
> and starting another, is a crontab oneliner.
>
> > rec -c 8 -b 16 -r 48k /Volumes/CAF3/test.caf
> > Oddly, it gives me this error:
> > rec WARN formats: can't set 8 channels; using 18
> > And it reports:
> > Input File     : 'default' (coreaudio)
> > Channels       : 18
> > Sample Rate    : 48000
> > Precision      : 32-bit
> > Sample Encoding: 32-bit Signed Integer PCM
> > Even so, it does record just 8 channels at 16 bit.
>
> I believe the error message means SoX was unable to set the
> audio device itself to be providing 8 channels, and is getting
> the whole 18 channels instead; but it creates an 8ch file out
> of it (using the first 8), as instructed.
>
> In other words, without the -c 8, SoX would be writing 1n 18ch file,
> using what it is given.
>
> > I then split it with another terminal window and:
> > ~/sox/sox /Volumes/CAF3/test.caf /Volumes/CAF3/test2.aif remix 1 2 trim 0 60
>
> You can put that in your crontab too,
> so that this happens after every chunk recording is finished.
>
> > So proof of concept, but: My current issue: why does SoX stop on its own?
>
> No idea. Run it with rec -V5 and post the debug messages.
>
>
>
>
> _______________________________________________
> Sox-users mailing list
> Sox-users@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/sox-users


> _______________________________________________
> Sox-users mailing list
> Sox-users@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/sox-users



_______________________________________________
Sox-users mailing list
Sox-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/sox-users

_______________________________________________
Sox-users mailing list
Sox-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/sox-users

[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux