JMF capture Audio and video (i)

Source: Internet
Author: User

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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.