I am trying to record sound using microphone and sox library in C/C++.
sox_open_read("default", &_input->signal, NULL, NULL)
I am trying to use default input device. I am getting the error
formats: can't open input file `default': No such file or directory
Which I guess is caused because I did not pass the last argument: filetype and sox tries to find a file with name 'default'.
Sox lists:
- Audio file formats: 8svx aif aifc aiff aiffc al amb au avr caf cdda cdr cvs cvsd cvu dat dvms f32 f4 f64 f8 fap flac fssd gsm gsrt hcom htk ima ircam la lpc lpc10 lu mat mat4 mat5 maud mp2 mp3 nist ogg opus paf prc pvf raw s1 s16 s2 s24 s3 s32 s4 s8 sb sd2 sds sf sl sln smp snd sndfile sndr sndt sou sox sph sw txw u1 u16 u2 u24 u3 u32 u4 u8 ub ul uw vms voc vorbis vox w64 wav wavpcm wv wve xa xi
- audio devices drivers: alsa, oss, ossdsp
What should I pass to the sox_open_read function as the last parameter to use a microphone as an input?