简体   繁体   中英

Streaming audio from windows output device to linux

I've been able to stream audio from a input device in windows to a Linux machine using LineInCode, plink (Putty) and PulseAudio but unfortunately there isn't an option to choose the Window's output device with LineInCode so I decided to make a program that it does.

A program developed by Matthew van Eerde already do most of the work. You can select an output device and record a wav file. So instead of writing in a file I should send it to the stdout and plink and pacat would do the rest. The audio format "recorded" with his program is type WAVE_FORMAT_EXTENSIBLE (SubFormat) and it should be streamed to the pacat as a PCM. So my question is how do I convert from SubFormat to PCM audio format?

Here's the command with linco:

linco.exe -B 16 -C 2 -R 44100 | plink -v 192.168.11.5 -l armbian -pw 1234 "cat - | pacat --playback"

PS: I've tried to be objective as I could, sorry for the long post. If you have an idea on how to shorten it please let me know how.

Follows the projects link: https://github.com/rsegecin/WLStream

The format recorded in the windows output device is PCM floating 32 bits little endian so pacat needed to be configured to be able to receive this kind of format accordingly. I posted the project in github . There were also the need to configure the output data in binary and use fwrite function because printf wasn't keeping up with data output.

See you there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM