开发者

Java Sound PCM Stream over wifi/tcp is very "staticy"

I've written a program that transmits a PCM stream from my pc to another pc or my android(using an AudioTrack). It uses java sound 开发者_JS百科and takes the target and source lines from the Stereo Mix mixer. Everything technically works (sockets, mixers, lines, streams, buffers, etc.) but the output on the remote speakers is very static-y sounding. Even when there isn't sound coming through, there is a constant crackling sound. I've tested the programs on my phone and computer with the same result.

What can I do? Thanks, Bill

ps The code is pretty big, and kinda messy, but I can post it somewhere if you ask.


Typically the static means you're feeding incorrect data to the audio subsystem: given what you describe there's probably an error in the audio path, and I'd suspect you are either:

  1. Experiencing some byte alignment issue when reading/transmitting/receiving the audio data from the source.
  2. Inadvertently mixing your network stream with local loopback audio on the receiving end.
  3. Feeding in invalid silence data (for sound subsystems that need to be constantly fed with audio data).
  4. Not feeding in silence data when you should be.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜