localisation_audio/carte_son_v1.cpp

20 lines
412 B
C++
Raw Normal View History

2020-05-22 18:03:11 +02:00
#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) ;
}