5

In Linux, I used to use the following command, which takes audio input, applies reverb and a pitch shift effects, and then outputs the result to the specified audio device.

sox -r 44100 -t alsa hw:1 -t alsa hw:0 reverb 1 50 10 50 pitch 100

On mac/OSX, I have installed the commandline audio utility sox, and I can record OR play audio using -d (default audio device), but I'm unable to get sox to do the same real-time audio manipulation that I did in Linux shown above. I think the key is finding out what to specify for the -t option

regulatre
  • 470
  • 1
  • 6
  • 18
  • 1
    I've linked to this in the [Ask Different chat room](https://chat.stackexchange.com/rooms/38/ask-different-chat), with this comment... QA from SU I find fascinating - I've been a Mac audio guy for 30 years & didn't know anything like this existed. I've always used some kind of GUI app/util to do this kind of thing; either ASIO, Soundflower [back in the day] or Rogue Amoeba. – Tetsujin Nov 30 '19 at 10:57
  • You learn something new every day ;-) – Tetsujin Nov 30 '19 at 10:57

1 Answers1

5

Indeed, the trick was 1. to specify -t coreaudio followed by the device name, and 2. figuring out what to use for the device name.

What to use for the device name:

$ sox -V6 -n -t coreaudio junkname

<snip>
sox INFO coreaudio: Found Audio Device "Built-in Mi"
sox INFO coreaudio: Found Audio Device "Built-in Ou"
sox INFO coreaudio: Found Audio Device "Scarlett 2i"

Full commandline:

sox -r 48000 -t coreaudio "Scarlett 2i2 USB" -t coreaudio "Built-in Output" reverb 1 50 10 50 pitch 100

I was able to run the command successfully with either the abbreviated names shown in the -V6 output, as well as the full name seen in sound settings under system preferences.

OS: Mojave/10.14, Darwin 18.7.0 Darwin Kernel Version 18.7.0: Sat Oct 12 00:02:19 PDT 2019; root:xnu-4903.278.12~1/RELEASE_X86_64 x86_64

regulatre
  • 470
  • 1
  • 6
  • 18