Skip to contentSkip to conversation

ALSA library name / other easy way to capture sound

DISCUSSION David Lee Lambert 2 participants 2 messages Apr 18, 2006 – Apr 19, 2006

lore
Share & tools
lore
#0 lore raw

I'm trying to write a program that captures a short audio segment (~10 s), stores it in a deque<float>, and does some linear-algebra on it. However, I've been having a lot of trouble reading audio input. At first I tried opening "rec" as a subprocess, but it seems to only respond to SIGINT when standard output is connected to a terminal.

I've also looked into using ALSA. I found the headers on my system, and my code seems to compile all right using them (I found the tutorial at
http://equalarea.com/paul/alsa-audio.html#basics helpful). However, when I try to link, I get errors like the following:

g++ -O1 -Wall -g -o test3 test3.cpp audioreader.o -shared -lalsa
/usr/bin/ld: cannot find -lalsa
collect2: ld returned 1 exit status
make: *** [test3] Error 1

Are the ALSA functions normally available in some shared library? What is it called? Is it a good idea to use it in such a simple application, or would I get acceptable performance by opening 'arecord' in a subprocess (and can I kill it after a specified time)?

Signature · 4 lines
David Lee Lambert ..... Student, Dept. Computer Science,
  Wayne State University (lab: 410 State Hall)
<[email protected]> or <[email protected]> or +1 586-873-8813
Homepage at http://paris.cs.wayne.edu/~as4109/
#1 lore raw
Quoted 3 lines · David Lee Lambert

Are the ALSA functions normally available in some shared library? What is it
called?

-lasound

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642