DegreeTeam / Sound-Streaming-System

0 stars 0 forks source link

4월 3주차 함준혁 일정 #14

Open hjh4638 opened 9 years ago

hjh4638 commented 9 years ago
hjh4638 commented 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

hjh4638 commented 9 years ago

링크가 안되는 문제가 발생!

gcc -o tune tune.c -lasound

와 같이 컴파일 시 -lasound를 붙여줘야함

CodeBlocks의 Project - build options - Linker settings 에서 -lasound를 추가해야함

hjh4638 commented 9 years ago

http://www.linuxjournal.com/article/6735?page=0,1

alsa 프로그램 예제 수록됨

hjh4638 commented 9 years ago

image

Open을 할때 파라미터로

핸들러, 장치이름, 타입, 모드를 넘겨줘야함.

이때 장치 이름으로 hw[CardNumber]:[DeviceNumber]으로 넘겨줘야한다.

아래는 이에 대한 스택오버플로우 답변

http://superuser.com/questions/53957/what-do-alsa-devices-like-hw0-0-mean-how-do-i-figure-out-which-to-use