Related articles: JMF capture audio and video (ii)
1. To capture media data:
L Query Capturedevicemanager to locate the media collection device you need to use.
L get a Capturedeviceinfo instance of this device.
L Get a medialocator from this capturedeviceinfo instance and create a datasource from it.
L Create a player or processor with this datasource.
L Start capturing media data by starting this player or processor.
2. Capturedevicemanager, Capturedeviceinfo, Medialocator
In JMF, Capturedevicemanager is also a manager class that provides a list of device names that the current system can use. At the same time, Capturedevicemanager can locate the device by querying and return the device's configuration information object Capturedeviceinfo, and it can also add a new device information to the list by registering the method to use for JMF.
The equipment can directly obtain the control of the equipment through the Capturedevicemanager GetDevice () method, and once the control of the equipment is obtained, the equipment can be used as a medialocator, can be obtained by Capturedeviceinfo's GetLocator () method.
3. JMF identification of audio acquisition equipment
4. An instance to implement audio capture
The instance has two files. Captureaudio.java implementation
① query, access to audio acquisition equipment.
② capture Audio.
③ saves the audio to the local file foo.wav.
Statehelper implements the state control management of the processor (processor). The following flowchart: