PDA

View Full Version : recording audio from a microphone



rwcitek
10-17-2005, 04:26 AM
Has anyone recorded audio from a microphone using Linux? If so, how?

I just want to record my voice saying hello world and save it as an .wav or .mp3 file. I've tried using Knoppix 4.0.2 by starting Audacity (K > Multimedia > Audacity ) and then clicking on the red Record button, but all I get is a loud hum (http://cwelug.org/~rwcitek/knoppix/audacity/loud.hum.ogg). Do I need to configure something else first, e.g. load a module, configure a device, something?

The machine is an eMachines T23341. lspci lists the sound card as "multimedia audio controller: VIA Technologies, In.c VT8233/A/8235/8237 AC97 Audio Controller (rev 50)." Been googling but haven't found anything helpful, yet. I've also been reading the Audacity tutorials (http://audacity.sourceforge.net/manual-1.2/tutorial_basics_4.html).

BTW, if I boot the same machine with Windows XP, everything works just fine using Sound Recorder, but I can only record 75 seconds.

Regards,
- Robert
http://www.cwelug.org

Harry Kuhman
10-17-2005, 04:57 AM
BTW, if I boot the same machine with Windows XP, everything works just fine using Sound Recorder, but I can only record 75 seconds.
Sorry, I don't have any answers about your hardware or Linux. But re the above quote, sound recorder is a typical MS "good enough for our users" type of program. OK for a quick test of audio in, but that's about it. If you want a great open source audio recording and editing program for Windows XP (and 98, as well as for Linux and MacOsX) that will get you past the MS limitation, look at Audacity (http://audacity.sourceforge.net/), availabe at the link provided and also as part of TheOpenCD (http://www.theopencd.org).

By the way, Audacity is on the Knoppix DVD (but not the CD), so you may be able to get it working from Knoppix too.

rwcitek
10-17-2005, 05:01 AM
By the way, Audacity is on the Knoppix DVD (but not the CD), so you may be able to get it working from Knoppix too.
Actually, Audacity is on the 4.0.2 CD, too. It's what I've been using. I just don't seem to be able to get it to record. Plays existing recordings just fine, though.

Regards,
- Robert
http://www.cwelug.org

Harry Kuhman
10-17-2005, 05:08 AM
Does seem like a hardware issue then. Strange, the CD package list that I checked didn't seem to show it (I didn't boot the CD and look). I may try it later on my main Knoppix system and let you know if I had any luck recording. But it will resolve your XP issue.

rwcitek
10-17-2005, 05:16 AM
I may try it later on my main Knoppix system and let you know if I had any luck recording. But it will resolve your XP issue.
That'd be great if you coudl confirm. I did just install Audacity on my Mac OS X 10.4. Works great, just as expected. So that does seem to suggest either a software error with Audacity on Linux (Knoppix) or incompatible hardware.

Regards,
- Robert
http://www.cwelug.org

atrick-pay
10-17-2005, 05:19 AM
make sure the "line-in" is active in Kmixer and that the input volume is up.

(Haven't had any trouble with my eMachines M5310 laptop)

Harry Kuhman
10-17-2005, 05:56 AM
That'd be great if you coudl confirm.
I just booted my 4.0.2 DVD (wanted to use the CD but it seems that although I've downloaded and seeded the CD version, I haven't actually burnt a copy yet). Will have to do that soon, but the system I burn with is tied up for a while. After boot I didn't do anything except start Audacity from the multimedia menu. Picked English as the language. Pressed the record button and talked into my microphone. It recorded the audio. Signal trace shows a nice strong level with no clipping. It doesn't sound that loud when played back, but it's certainly there and what I recorded. Maybe my playback volume needs increased. This is on an HP Ze4240 notebook with on-board audio.

rwcitek
10-17-2005, 07:20 PM
make sure the "line-in" is active in Kmixer and that the input volume is up.
Here are some image captures: kmix input (http://cwelug.org/~rwcitek/knoppix/audacity/kmix.input.png), Audacity record screen (http://cwelug.org/~rwcitek/knoppix/audacity/audacity.record.v02.png), Audacity preferences (http://cwelug.org/~rwcitek/knoppix/audacity/audacity.prefs.v02.png).


(Haven't had any trouble with my eMachines M5310 laptop)
What sound card do you have? That is, what does lspci list for your soundcard?

Regards,
- Robert
http://www.cwelug.org

Markus
10-17-2005, 08:23 PM
Just to test the mic I usually use:
rec -d /dev/dsp2 file.wav
ctrl-c
play file.wav
Yours might be dsp0, "cat /proc/asound/cards" will tell the number.

Harry Kuhman
10-17-2005, 11:31 PM
Another update: I burnt the 4.0.2 CD and tried it on my main system with slightly different results. Audacity was indeed there, I started it. This system has a different sound card than the HP notebook I used previously; it's a cheap generic PCI sound card that Windows device manager identifies as an ALS4000 Audio Device. This time Audacity didn't record the sound at first as I spoke into the mic. I had to use the control on Audacity to switch from line-in to mic, which I didn't use on the HP notebook. It then did record the audio, but the sound was so low that the waveform did not show up on the plot and I could barely hear it when played back, but I could hear it and so it was recorded. I expect it's a mic level or boost issue and I have not figured out yet how to crank the input volume up under Knoppix, but Audacity is now 2 for 2 for me in Knoppix if I can count this as a sucess.

rwcitek
10-21-2005, 07:58 PM
Thanks, Markus. Here's the output:


root@0[~]# rec -d /dev/dsp2 file.wav
Send break (control-c) to end recording
sox: Can't open input file '/dev/dsp2': No such device

root@0[~]#cat /proc/asound/cards
--- no soundcards ---

root@0[~]# ls -la /dev/dsp*
lrwxrwxrwx 1 root root 9 May 3 17:11 /dev/dsp -> /dev/dsp0
crw-rw-rw- 1 root audio 14, 3 Apr 5 2005 /dev/dsp0
crw-rw-rw- 1 root audio 14, 19 Apr 5 2005 /dev/dsp1
crw-rw-rw- 1 root audio 14, 35 Apr 5 2005 /dev/dsp2
crw-rw-rw- 1 root audio 14, 51 Apr 5 2005 /dev/dsp3


This seems to suggest that I have no sound card. Yet, the following worked just fine:


root@0[~]# play /KNOPPIX/opt/openoffice/share/gallery/sounds/top.wav
playing /KNOPPIX/opt/openoffice/share/gallery/sounds/top.wav
Thoughts? What else should I be looking for? Do I need to load a module or configure something?

Regards,
- Robert
http://www.cwelug.org

Markus
10-22-2005, 07:06 AM
Looks like you're using oss instead of alsa. It's usable too but alsa is more configurable and newer. See if via82cxxx_audio is in /etc/hotplug/blacklist.d/alsa-base and add it there if not. Also rmmod it so you can test alsaconf.
Alsa modules start with snd- and yours would be snd_via82xx. You can run alsaconf after blacklisting the oss module and rebooting.
You could also try the cheatcode alsa=via82xx