简体   繁体   English

将音频从Windows输出设备流传输到Linux

[英]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. 我已经能够使用LineInCode,plink(Putty)和PulseAudio将音频从Windows的输入设备流传输到Linux机器,但是不幸的是,没有选择LineInCode的窗口输出设备的选择,所以我决定制作一个程序它做到了。

A program developed by Matthew van Eerde already do most of the work. Matthew van Eerde开发的程序已经完成了大部分工作。 You can select an output device and record a wav file. 您可以选择一个输出设备并记录一个wav文件。 So instead of writing in a file I should send it to the stdout and plink and pacat would do the rest. 因此,与其写入文件,不如将其发送到stdout,其余的工作由plink和pacat完成。 The audio format "recorded" with his program is type WAVE_FORMAT_EXTENSIBLE (SubFormat) and it should be streamed to the pacat as a PCM. 用他的程序“记录”的音频格式为WAVE_FORMAT_EXTENSIBLE(子格式),应将其作为PCM流式传输到pacat。 So my question is how do I convert from SubFormat to PCM audio format? 所以我的问题是如何从SubFormat转换为PCM音频格式?

Here's the command with linco: 这是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. PS:我尽力做到客观,对冗长的帖子表示抱歉。 If you have an idea on how to shorten it please let me know how. 如果您有关于缩短时间的想法,请告诉我。

Follows the projects link: https://github.com/rsegecin/WLStream 跟随项目链接: 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. Windows输出设备中记录的格式是PCM浮动32位小尾数,因此需要配置pacat以便能够相应地接收这种格式。 I posted the project in github . 我将项目发布在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. 还需要用二进制配置输出数据并使用fwrite函数,因为printf不能跟上数据输出的速度。

See you there. 到时候那里见。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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