Simulate Microphone (virtual mic) Simulate Microphone (virtual mic) linux linux

Simulate Microphone (virtual mic)


Your sound will come over the network and what would cache it until something wants to read? Or would data be discarded?In general something like the below (only barely tested) should work as a virtual mic, but I think that it will always read file from beginning when device opened and you need to check how does it handle end of file. Perhaps what you would try it using pipes but then caching/discarding incoming data needs to be handled by the app reading from network.

pcm.virtmic {    type file    format "raw"    slave.pcm "default"    file '/dev/null'    infile '/dev/urandom'}

See alsa docs for more options.

Again, not sure if this tool is what you really need for the task. It would have been really nifty if you could start a command with the 'infile' option, like you can with 'file' but unfortunately you can't...

Hope that helps.

UPDATE: slave.pcm must not be "null" but some real device. It seems that is used for timing or I don't know but using null causes the recorder process to block forever. This device could force you at a given sample rate though so be careful. Using "default" is a sane default value. infile needs to provide a raw sound data with the correct/matching format and rate. btw you can look at alsa server and jackd and other sound systems and libraries for alternative solutions for your task