[alsa-devel] pcm file question

Leigh Stewart leigh.stewart at elasticpath.com
Thu Dec 20 09:20:10 CET 2007


hey all,

im writing a little app that needs to tie into the audio in/out-put from
another alsa application. in other words i need to take all audio produced
by the app and do some work with it, and supply data to its audio input.

im not sure but i think the pcm_file plugin will allow me to do what i need
to do. i.e. i as i understand it i could tie the audio output to a fifo file
using the plugin, and then read from the file.

anyway im not sure how write a program that uses the plugin code. i wrote
something like

...
> #include <alsa/asoundlib.h>
> #include <iostream>
> #include <alsa/pcm.h>
> #include <alsa/pcm_plugin.h>
> ...
> err = snd_pcm_file_open (&pcm_handle, pcm_name, (char*)0, fdo, (char*)0,
> fdi, "raw", 777, capture_handle, 0);
> if(err < 0) {
>   fprintf (stderr, "cannot open pcm_file device %s (%s)\n", pcm_name,
> snd_strerror (err));
>   exit (1);
> }


but there are no method signatures in pcm_plugin.h. i've tried building alsa
from source 1.0.15. i see method signatures for copy and dmix, and even
jack, but not for file.

how can i compile the plugin in? can i even use pcm_file programmatically?
can anyone refer me to any examples?

thanks,

lstewart


More information about the Alsa-devel mailing list