Re: Recording specific channels

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

 



(I first put this paragraph at the end of this email, but I’d be burying my lead.)

 

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?

 

Longer explanation:

 

Yes, I split the .CAF files with a script (AppleScript that sends a shell script with sox) every hour to aif. 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. We reset Logic once every day (with scripts, and lose about 400 ms).

 

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. I’ve thought about stripping silence in the other files, but it’s not really worth it. We just compress them after 2 months. (At the end of the year we just put the hard drive on a shelf. I’ve retrieved concerts and masterclasses 10 years back.)

 

Before Logic we used Audio Companion, which allows you to turn the recording on and off based on silence, but recent changes with OS X broke our methods, which included modifying the source code. That also was problematic because it created files with odd times. The Logic method allows exact time frames.

 

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. 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. It does what we need. Mostly my staff understands Logic and while SoX might allow similar functionality, I don’t understand it as well, and we know Logic.

 

(“Right”) Yes, good point. AP is just guessing at my intention with the file, but it’s correct for what I’m doing, stereo pairs in each room.

 

Yes, my mistake, it was ~/sox/rec -c 2 out.aif

 

But all this is moot. I’ve gotten it to work the way you suggest, record all 8 channels with:

 

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 then split it with another terminal window and:

 

~/sox/sox /Volumes/CAF3/test.caf /Volumes/CAF3/test2.aif remix 1 2 trim 0 60

 

So proof of concept, but: My current issue: why does SoX stop on its own?

 

5/12/24, 09:24, "Jan Stary" <hans@xxxxxxxx>:

 

On May 11 10:50:14, jn.ml.sxu.88@xxxxxxxxxxxxxxxxxxxx wrote:
> On 2024-05-10 23:56, Michael Cottle, (David) wrote:
> > I need to record specific channels from a multi-channel interface.
> I would GUESS that how you do this depends on whether the audio interface(s)
> always send all channels of audio, or only those you choose on the inteface
> itself.

Is anyone aware of an audio interface that lets you choose
which channel it sends? I have only seem sound cards that
always send everything.

> Then the file (or stream) of audio might contain header info saying (to sox)
> how many channels of data are being sent.  Or it might not in which case you
> would HAVE TO TELL sox what is coming in.

Again, is anyone aware of a sound interface that sends something else
than the raw audio data (as expected)? I haven;t seen anything that
would send, say, a wav file. (How would the length possibly be right
in the header that comes first, for example?)

On May 11 16:47:55, D.Cottle@xxxxxxxx wrote:
> We are recording 4 spaces of a music building 24/7 using stereo pairs.

Surely you are cutting these at some point (midnight?),
chunking the 24/7 into some managable recordings.

> Logic is just a shell we use (because it has a nice interface)
> to write the CAF files, then we use SoX to split them up every hour.

But it's not one endless CAF file, right?
So what exactly is Logic Pro writing?

> We also use SoX to discard silent files.

Does that mean you always record everything,
even the silence in the rooms where nothing happens?

> The problem is, Logic can be flakey, so we are investigating
> SoX as the recording device also.

You said you use Logic for its nice interface?
In what way is Logic's interfaces nicer that SoX's?

> I think I solved my initial issue:
> I’m currently experimenting with a Focusrite Clarett
> which has 8 analog and 10 digital inputs.
> rec test.aif
> Records all 18 channels in order.

> When I open that in Amadeus Pro it correctly recognizes it
> as 9 stereo channels.

Whether that is "right" depends of course: if I record 6 channels of drums,
6 of vocals and 6 of the horn section, showing those 18 mono channels
as 9 stereo channels isn't "right".

> rec -c 2 test.aif
> Records the first two channels.
> rec -c 8 test.aif
> Records the first 8 channels.

I believe SoX gets all 18 when reading from the audio device,
but only uses the first -c N to create the N-channel output.

> I have then successfully used remix to split up the files into
> stereo tracks (the end goal). I didn’t think remix could be used
> when recording, just with existing files. But I just tried:
> rec -c test.aif remix 3 4
> And that recorded just tracks 3 and 4, which was my original question.

That is not a valid SoX command line.
Do you mean "rec -c 2 test.aif remix 3 4" ?

> I then opened two terminal windows and recorded
> tracks 1 and 2 using one instance of sox, then 3 and 4 with the other.

"Then"? So you missed channels 3 and 4 while recording 1 and 2
- but you want to be recording all of 1-8 all the time, right?

> That also worked, which was likewise my original goal.
> But now the question is, am I going about it incorrectly
> and taxing the system or sox using remix during the recording process?
> It is handy to have all the separate CAF files as stereo pairs
> (for each room), but would it be more efficient to record all 8 channels
> to a single file, then split them up using SoX and remix?

Read about remix in the SoX manpage.
You simply specify the contributing channels.

I would just record 1-8 into one file, with one SoX instance,
as that is what you want to have anyway, and split into 1-2, 3-4 etc
offline later. Would SoX even have the device available four times
simultaneously, if you ran the four instances?

You need to write eight channels of audio. I don't think it is more
"taxing" to write one 8ch file instead of writing four 2ch files
(each discarding 6 channels of input). On the contrary, it is more simple,
while the amount of writing work is the same.

You might want to look into OpenBSD's superb "sndio" subsystem
and its native "aucat" tool, which can split an audio device
into subdevices by channels.

> I wonder if something like linux's "tee" can make a second copy (on
> another disk) of the 8-ch file in parallel with the first.

A triviality with https://man.openbsd.org/aucat

        Jan



_______________________________________________
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