Outputting pipes from aplay to iscord on centos
I am trying to automate some tests for a websocket client. This client connects to the server on command, and the server is basically a text engine. The client supports streaming audio from a microphone, so people can record themselves in real time and feed it to the engine. I am running a client in a centos virtual machine that does not have a physical sound card, so I decided to simulate one using
modprobe snd-dummy
My plan is to output the output
aplay audioFile.raw
at the entrance
arecord test.raw -r 8000 -t raw
so that I can use this to simulate the microphone function. I read online that the file plugin for ALSA can pipe the results of one command to the next, so I made the following changes to the .asoundrc file in the root directory:
pcm.!default {
type hw
card 0
}
pcm.Ted {
type file
slave mySlave
file "| arecord test.raw -r 8000 -t raw"
}
pcm_slave.mySlave {
pcm "hw:0,0"
}
ctl.!default {
type hw
card 0
}
When trying to run the following command:
aplay audioFile.raw -D Ted
It seems to work fine, but the output of test.raw only seems to contain silence ... Does anyone know what I am doing wrong, I am very new to ALSA, so if anyone can point me in the right direction, that would be greatly appreciated. Thank you!
source to share