Skip to contentSkip to conversation

pcm file question

DISCUSSION Leigh Stewart 1 participant 1 message Dec 20, 2007

lore
Share & tools
lore
#0 lore raw

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

...

Quoted 4 lines

#include <alsa/asoundlib.h>
#include <iostream>
#include <alsa/pcm.h>
#include <alsa/pcm_plugin.h>

Quoted 8 lines

...
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