Re: virtual microphone

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 24 February 2010 03:17:12 pm Peter Lukac wrote:
> On Wednesday 24 February 2010 11:44:17 am you wrote:
> > On Wed, 24 Feb 2010, Peter Lukac wrote:
> > > Hello everyone,
> > >
> > > I need debug my program with alsa driver and i need something like
> > > virtual microphone. I would like device "microphone" where i can put
> > > sound file and this file will be input for microphone stream. And in
> > > application i get this stream from this "microphone"
> >
> > Use file plugin in alsa-lib or snd-aloop kernel module as loopback.
> >
> > http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html
> >
> >  					Jaroslav
> >
> > -----
> > Jaroslav Kysela <perex@xxxxxxxx>
> > Linux Kernel Sound Maintainer
> > ALSA Project, Red Hat, Inc.
>
> Hi again :)
>
> Thanks for reply. I think this should by work..
> but i'm confused with asound.conf file.
>
> i have:
>
> pcm.virtmic {
>         type file
>         slave {
>                 pcm {
>                         type hw
>                  }
>         }
>         infile  /opt/raw.dat
>
> }
>
> and i can't see it with aplay -L  ...yes i think it is bad :(
>
> What is slave and pcm section? And why is
> pcm section in slave and slave is in pcm section? is any documentation
> which explain this? i try find it but without success. Maybe i'm blind but
> anywhere is lots of examples and no explanation what is slave and pcm
> section and how it works together....
> or can me put here some very basic example how to create virtual microphone
> with default soundcard?
>
>
> and...
> is some easy commad how can i create raw data from wav file? or i have to
> make file plugin for write?
>
> thanks
>
>


OK again :)

i found some article at
http://alsa.opensrc.org/index.php/.asoundrc#Plugins

i created following config:

pcm.sc {
    type hw
    card 0
}

pcm_slave.smic {
    pcm sc
    #channels 2
    #rate 8000
}

pcm.vmic {
        type file
        slave smic
        infile "/opt/pokus.dat"
        format "raw"
}

when i run command:
arecord -Dplug:vmic

and uncomment line with channels  or rate i get error:
ALSA lib pcm.c:6644:(snd_pcm_slave_conf) Unknown field channels
or 
ALSA lib pcm.c:6644:(snd_pcm_slave_conf) Unknown field rate

but when i comment these lines i get :

ALSA lib pcm_file.c:604:(_snd_pcm_file_open) file is not defined

why? i defined file as  infile "/opt/pokus.dat"
and why field channels and rate are unknown? 

but when i change infile for output as

file "/opt/pokus.dat"

and run :
aplay -Dplug:vmic my_wav.wav

it's works.


thanks

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user

[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux