Search code examples
batch-filecommand-lineaudio-recordingsox

How to use sox to record audio from command line


I want to record audio with this code: sox -d test.wav trim 0 20 but the problem is that it says: sox FAIL sox: Sorry, there is no default audio device configured and if I try some other sox codes it gives me help of sox. There is no other way to record audio(Or at least no other way to record audio from command line)?


Solution

  • SoX 14.4.2 for MS Windows has trouble identifying the default audio device. There are two possible solutions:

    1. Replace -d with -t waveaudio 0. If you have multiple audio devices (e.g. a USB microphone next to the regular mic plug), then you may need to replace 0 with 1 or higher.
    2. Uninstall SoX 14.4.2, install SoX 14.4.1 instead.

    Source: