Yes, Dear, I'm Listening: Reading Audio from an Input Line

In the previous section we worked with an audio output, creating a SourceDataLine and sending some random data through it to the speaker. The Java Sound API also allows you to capture audio data from an input line such as a microphone. In this section, we will record audio into a data buffer, where it can be processed or saved to a file. There may be many input ports on the computer depending on the hardware configuration. To be sure we are using the correct device, we can let the user select from a list of installed mixers and select the appropriate line from the mixer (similar ...

Get Wicked Cool Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.