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)?
Asked
Active
Viewed 3,007 times
-1

Sepehr Movasat
- 49
- 1
- 10
-
It sounds like you haven't configured Sox to record audio, or you haven't configured your microphone to be the default recording device. I've never used Sox, but presumably there's some documentation somewhere about how to set the program up. – SomethingDark Apr 13 '21 at 15:48
-
What is your OS? I am asking because this is a known issue on Windows with SoX version 14.4.2. And the only solution I know of is to downgrade to 14.4.1. – Ruud Helderman Apr 17 '21 at 15:54
-
I am using windows. – Sepehr Movasat Apr 19 '21 at 14:40
-
So, how to downgrade? – Sepehr Movasat Apr 19 '21 at 14:41
1 Answers
1
SoX 14.4.2 for MS Windows has trouble identifying the default audio device. There are two possible solutions:
- 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 replace0
with1
or higher. - Uninstall SoX 14.4.2, install SoX 14.4.1 instead.
Source:

Ruud Helderman
- 10,563
- 1
- 26
- 45