20 lines
412 B
C++
20 lines
412 B
C++
|
#include <cstdio>
|
||
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
#include "/usr/include/alsa/asoundlib.h"
|
||
|
|
||
|
|
||
|
|
||
|
int main () {
|
||
|
int err ;
|
||
|
snd_pcm_t* _capture_handle ;
|
||
|
const char* device = "hw:0,0" ;
|
||
|
|
||
|
/*
|
||
|
hw:0,0 est plus "léger" que plughw:0,0
|
||
|
*/
|
||
|
|
||
|
if ((err = snd_pcm_open(&_capture_handle, device,SND_PCM_STREAM_CAPTURE, 0)) < 0) fprintf(stderr, "cannot open audio device %s (%s)\n", device, snd_strerror(err)) ;
|
||
|
exit(1) ;
|
||
|
}
|