A Microphone captures audio data from the system's underlying audio input systems. Converts these audio data into Data objects. When the method
startRecording()
is called, a new thread will be created and used to capture audio, and will stop when
stopRecording()
is called. Calling
getData()
returns the captured audio data as Data objects.
This Microphone will attempt to obtain an audio device with the format specified in the configuration. If such a device with that format cannot be obtained, it will try to obtain a device with an audio format that has a higher sample rate than the configured sample rate, while the other parameters of the format (i.e., sample size, endianness, sign, and channel) remain the same. If, again, no such device can be obtained, it flags an error, and a call
startRecording
returns false.