Advertisement
CashEclipse

Untitled

Apr 19th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.91 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # This script will create a virtual microphone for PulseAudio to use and set it as the default device.
  4.  
  5. # Load the "module-pipe-source" module to read audio data from a FIFO special file.
  6. echo "Creating virtual microphone."
  7. pactl load-module module-pipe-source source_name=virtmic file=/home/charles/audioFiles/virtmic format=s16le rate=16000 channels=1
  8.  
  9. # Set the virtmic as the default source device.
  10. echo "Set the virtual microphone as the default device."
  11. pactl set-default-source virtmic
  12.  
  13. # Create a file that will set the default source device to virtmic for all
  14. PulseAudio client applications.
  15. echo "default-source = virtmic" > /home/charles/.config/pulse/client.conf
  16.  
  17. # Write the audio file to the named pipe virtmic. This will block until the named pipe is read.
  18. echo "Writing audio file to virtual microphone."
  19. while true; do
  20.     cat audioFile0.raw > /home/charles/audioFiles/virtmic
  21. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement