Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
It's not realistic to think the user has only one audio input device. The computer might be connected to a headset for audio conferencing, a webcam for video conferencing, and a camcorder for dumping pictures of the summer vacation into iMovie. Ideally, it should be possible to discover connected devices at runtime and specify which is to be used for capture.
To provide a list of devices, you need to query the SGAudioChannel for what devices are available, and then present the choice to the user. So, take the code from the previous lab and add an AWT Choice called deviceChoice in the constructor (replacing a line with a comment that said "reserved for next lab"). Next, after the SGSoundChannel is created in setUpAudioGrab( ), insert this block of code to search for audio devices, adding the name of each to the deviceChoice: