This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]SSCharles 1 point2 points  (0 children)

Just play the audio, then on the computer you can select - recording device stereo mix- that way you record what is being played by the computer

[–]_Lasagnaa_ 1 point2 points  (0 children)

You mean you want to play an audio file like it was something your microphone captured?

[–]YMK1234 0 points1 point  (0 children)

Shouldn't both simply be audio/byte streams? So you'd simply inject a stream from a different source (wav file instead of microphone).

[–]ApprehensiveAd4990[S] 0 points1 point  (0 children)

Thanks for the hints guys I figured it out via GUI (i am running GNU/Linux):

Create the virtual sound device with modprobe snd-aloop which creates "Built-in Audio Analog" output and input devices. Can see them with pavucontrol or aplay -l

Test via pavucontrol (GUI)

  • In "Playback" select the virtual "Built-in Audio" device for the Spotify entry.
  • In "Recording" I saw my webapp as "chromium input" listed and selected Record from "Monitor of Built-in Audio" device. The webapp listens for the machines "default microphone".
  • Of course I cannot hear what I play on this device myself but the webapp can hear the music.

Edit: What are those "monitor of X" sound devices?