Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've tried :

avconv -f alsa -i pulse recod.wav

..but it doesn't capture anything. Have any idea?
Thanks!

share|improve this question

1 Answer 1

up vote 6 down vote accepted

The syntax to invoke avconv is nicely explained in the manpage for avconv. From audio recordings the following options are available:

-f: Force input or output file format.
-i: input file name

To record from ALSA we need the format to be alsa, and the input depends on the device we record (usually this will be the defualt device). Then your command should be as follows:

avconv -f alsa -i default record.wav

To simply record from an ALSA device we may consider using the more basic command line tool arecord. This gives the following example command for a 10 second (-d) recording in cd quality (-f) in wav codec (-t):

arecord -d 10 -f cd -t wav -D copy record.wav

To be able to record from an output sink, we may have to choose a duplex audio profile in "Sound Settings --> Hardware":

enter image description here

Unfortunately In >= 13.04 the hardware configuration was removed from the sound settings. To have access to advanced device configurations we need to install and run pavucontrol Install pavucontrol. The duplex profile can then be selected in the Configuration tab:

enter image description here

share|improve this answer
    
Thanks for the answer, but avconv -f pulse -i default record.wav doesn't work for me..Terminal output hilights this: [pulse @ 0x1dfad60] Estimating duration from bitrate, this may be inaccurate and I end up with a 34KB small wav file.. –  Naveen May 9 '13 at 10:16
    
With ALSA, I'm having 3.8MB file, but there is nothing in it.. just an empty clip. :( –  Naveen May 9 '13 at 10:29
    
Ohmy god! I don't have a hardware tab like yours!... I do have an option to change profile in output tab...but there's no Duplex. I've only got Analog stereo output.... I'm on Raring Ringtail.. –  Naveen May 10 '13 at 16:40
    
Worked this time :) Thanks a lot! –  Naveen May 13 '13 at 5:51
    
Duplex is important if you want to listen to what you record otherwise other settings would work as well for pure recording. I wrote a huge how-to on meshfields.de/audio-stream-recording-linux-avconv –  Achmed Durangi May 12 at 23:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.