Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is the difference between AudioInputStream and TargetDataLine?

0
Posted

What is the difference between AudioInputStream and TargetDataLine?

0

InputStream represents a stream of bytes that may be read from a file, URL or other data source. AudioInputStream extends InputStream with properties that are needed for interpreting audio data: the data format (an AudioFormat object) and the length of the stream in frames. An AudioInputStream instance can be wrapped around any InputStream object to provide this information. TargetDataLine is much more specific: it represents an audio line to which data is output from an audio device (represented by a Mixer object). Data recorded from an audio capture device is delivered to a TargetDataLine, from which it can be read by the application. So lines of various types (TargetDataLine, SourceDataLine, Clip, Port) are not arbitrary software objects that can be created and connected to a mixer or audio device. Rather, they are part of the mixer or device itself. The difference between AudioInputStream and TargetDataLine is mirrored by the difference between AudioOutputStream and SourceDataLine.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123