static void * alsa_init(G_GNUC_UNUSED const struct audio_format *audio_format, const struct config_param *param, G_GNUC_UNUSED GError **error) { struct alsa_data *ad = alsa_data_new(); alsa_configure(ad, param); return ad; }
int alsa_init () { int err; char *device = "default"; size_t chunk_bytes = 0; if ((err = snd_pcm_open (&AHandle, device, SND_PCM_STREAM_PLAYBACK, 0)) < 0) { fprintf (stderr, "Playback open error: %s\n", snd_strerror (err)); exit (1); } err = snd_output_stdio_attach (&Log, stderr, 0); assert (err >= 0); chunk_bytes = alsa_configure (); return chunk_bytes; }