Open hjh4638 opened 9 years ago
sound programming을 하기 위해선 alsa 드라이버를 사용해야함. alsa/asoundlib.h를 쓰기 위해서는 패키지를 설치해야함.
apt-get install libasound2-dev
http://raspberrypi.stackexchange.com/questions/15018/sound-recording-program-using-nano
링크가 안되는 문제가 발생!
gcc -o tune tune.c -lasound
와 같이 컴파일 시 -lasound를 붙여줘야함
CodeBlocks의 Project - build options - Linker settings 에서 -lasound를 추가해야함
http://www.linuxjournal.com/article/6735?page=0,1
alsa 프로그램 예제 수록됨
Open을 할때 파라미터로
핸들러, 장치이름, 타입, 모드를 넘겨줘야함.
이때 장치 이름으로 hw[CardNumber]:[DeviceNumber]으로 넘겨줘야한다.
아래는 이에 대한 스택오버플로우 답변