Recording Stereo Mix and Microphone at the same time

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Recording Stereo Mix and Microphone at the same time

Dino Vidakovic
I'm trying to record both sources at the same time into a single file. Is this possible with Sox? If not, does anyone have any ideas or best practices to achieve this?

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Recording Stereo Mix and Microphone at the same time

Fmiser
> Dino wrote:

> I'm trying to record both sources at the same time into a single
> file. Is this possible with Sox? If not, does anyone have any
> ideas or best practices to achieve this?

Do you have three channels of DAC (digital to analog conversion).
A typical sound card will only have two.  Unless you have a card
or interface with more, the only possible way to do it is to mix
the stereo to mono with external hardware (2 resistors) and then
have one channel the mic and the other as the now mono mix.

If you have enough DACs to do three tracks at once, then SoX
should be able to accommodate.

A third option is to record the two sources an different times.
That is, record the stereo, then play back the stereo and record
the mic. This is called "over-dubbing".  SoX is not well suited to
this type of work.  I would recommend ecasound, a command-line
multi-track audio editor.  It is not as versatile as SoX, but it
better suited to multi-track DAW (digital audio workstation) task.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Recording Stereo Mix and Microphone at the same time

Doug Lee
In reply to this post by Dino Vidakovic
On Mon, Apr 24, 2017 at 02:15:55PM +0200, Dino Vidakovic wrote:
>    I'm trying to record both sources at the same time into a single file.
>    Is this possible with Sox? If not, does anyone have any ideas or best
>    practices to achieve this?

If you just mean two devices into one file, I would think something like this would work, where your device names may vary:

sox -m -t waveaudio "Microphone (Logitech Wireless H" -t waveaudio "Microphone (Andrea PureAudio US" outfile.wav

Timings may vary slightly among devices though; so if you're trying to get real-time, more-than-two-channel data mixed down to two channels, your results may and may not be pleasing.

--
Doug Lee                 [hidden email]                http://www.dlee.org
SSB BART Group           [hidden email]   http://www.ssbbartgroup.com
"If you refuse to be made straight when you are green,
you will not be made straight when you are dry." {African}

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Recording Stereo Mix and Microphone at the same time

Måns Rullgård
Doug Lee <[hidden email]> writes:

> On Mon, Apr 24, 2017 at 02:15:55PM +0200, Dino Vidakovic wrote:
>>    I'm trying to record both sources at the same time into a single file.
>>    Is this possible with Sox? If not, does anyone have any ideas or best
>>    practices to achieve this?
>
> If you just mean two devices into one file, I would think something
> like this would work, where your device names may vary:
>
> sox -m -t waveaudio "Microphone (Logitech Wireless H" -t waveaudio "Microphone (Andrea PureAudio US" outfile.wav
>
> Timings may vary slightly among devices though; so if you're trying to
> get real-time, more-than-two-channel data mixed down to two channels,
> your results may and may not be pleasing.

There are two time-related issues with this.  Firstly, the two devices
may not start recording at exactly the same time.  The tracks will then
have to be realigned after recording, which is easy enough if they all
start with an externally generated sync signal.  Secondly, the ADC
clocks of the devices can (will) drift relative to each other eventually
leading to a buffer overflow or underflow since Sox assumes all inputs
have synchronised samples.  There is no easy fix for this.

--
Måns Rullgård

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: Recording Stereo Mix and Microphone at the same time

Jan Stary
On Apr 24 14:15:55, [hidden email] wrote:
> I'm trying to record both sources at the same time into a single file. Is
> this possible with Sox? If not, does anyone have any ideas or best
> practices to achieve this?

If all the inputs are different channels of the same audio device,
than this is no different than recording any other number of channels
from a single device. But that's probably not what you have.
Is the (mono?) mic connected through one audio card
and the "stereo mix" (a line-in from somewhere?) through another?

I assume you want to record both at the same time, synchronized
(such as a vocal or a solo over a mix of the instrumental tracks).
Or you want to play the stereo mix as an accompaniment and record the mic,
synchronized to the accompaniment (overdubbing).

It is more the underlying audio system's work to do this,
i.e. to warant the synchronization. For example, OpenBSD's sndio
subsystem is very good at this; e.g.

        aucat -i backing.wav -o solo.wav

will play backing.wav as an input and record solo.wav as an output,
with sample-precision. SoX is probably not the best tool for this.


        Jan


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users