How to Record Audio to a Computer Using an Audio Interface
Why use an audio interface?
An audio interface gives a cleaner signal than a computer microphone. It can eliminate room noise. Musicians and podcasters use them with external instruments and microphones. Also an audio interface may offer a way to send audio to a Raspberry Pi.
Application- tv_commercial_silencer
tv_commercial_silencer monitors live audio, detects and automatically mutes commercials It compares live audio input to a database of “acoustic fingerprints” generated from previously recorded commercials.
recording and monitoring television audio
Configure macOS to use audio interface input
Go to System Preferences / Sound / Input. Select the interface.
Configuring Raspberry Pi Raspbian to use audio interface input
I’ve seen online reports of people doing this. I haven’t done it yet.
Digital Audio Workstation (DAW)
In Ableton Live Lite I set the input as 1/2 for stereo. Then I recorded audio, split and trimmed into individual clips, one per commercial.
mp3 files
I exported each clip as a mp3 file. mp3 maintains separate stereo channels. In tv_commercial_silencer I stored the files locally in directory data/commercial_mp3. The project .gitignore ignores the data directory and the recordings aren’t commited to the repository.
Appendix- audio interface configuration
input jacks
These accept 1/4 inch (6.35 mm) diameter phone plugs. Can use TR (tip ring, 2 contacts) or TRS (tip ring sleeve, 3 contacts)
unbalanced input
Ok for short cables < 20 foot long. If you connect TR plug, connection is unbalanced mono.
balanced input
Good noise rejection over long cable runs. Uses 1/4 inch phono plug TRS (tip ring sleeve 3 contacts) One wire carries -1 * signal in another wire, third wire is ground. If you connect a TRS plug, the interface attempts to process it as a mono “balanced” audio connection.
how to connect line level stereo input
NOTE: 3 wire stereo output from television must be split out to 2 mono TR plugs, then each plugged in to channel 1 and 2. I put TIP (gray) on channel 1 and RING (red) on channel 2.
input gain knob
Turn up as long as ring light is green. If ring light turns red, amp is clipping. Reduce gain. I set both channel 1 and channel 2 to approximately 1 o’clock position.
input switch
For recording line input use LINE not INSTRUMENT.
Pad
Attenuates input to avoid clipping. Don’t use unless necessary. I didn’t use it.
Direct monitor knob
Mixes between live input with no delay and playback which may have post-processing latency.
Direct monitor switch
Stereo.
source switch
For headphones. Can configure DAW so 1-2 monitors live input, 3-4 monitors playback.
References
Audio interface, Focusrite Scarlett 2i4
https://focusrite.com/usb-audio-interface/scarlett/scarlett-2i4
Support download files including User Guide scarlett2i42ndgenugenv1.pdf
https://customer.focusrite.com/support/downloads?product=Scarlett%202i4
Guitar Center
I bought from Guitar Center in Redmond WA and got excellent in-person advice and technical support from salesperson Alex.
Digital Audio Workstation DAW, Ableton Live Lite
bundled with Focusrite audio interface
Python Data Analysis to Automatically Detect and Mute Television Commercials
https://beepscore.com/website/2019/04/21/automatically-detecting-television-commercials.html
tv_commercial_silencer
https://github.com/beepscore/tv_commercial_silencer
Recording multiple microphones in python
Discusses using PyAudio and Scarlett audio interface https://stackoverflow.com/questions/25620285/recording-multiple-microphones-in-python