【问题标题】:JMF microphone volume controllerJMF 麦克风音量控制器
【发布时间】:2010-06-13 17:48:10
【问题描述】:

JMF中如何获取麦克风音量控制器?

这就是我所拥有的:

我尝试了你的这个实现概念,但是当我尝试获取流时,我一直从第一个卷处理器得到一个空值,我是这样做的:

// the device is the media device specifically audio
Processor processorForVolume = Manager.createProcessor(device.getLocator());

// wait until configured
ProcessorStates newState = new ProcessorStateListener(Processor.Configured).waitForProcessorState(processorForVolume);
System.out.println("volumeProcessorState: "+newState);

// setting the content descriptor to null - read in another thread this allows to get the gain control
processorForVolume.setContentDescriptor(null);

// set the track control format to one supported by the device and the track control.
// I didn't match it to an RTP allowed format, but I don't think this has anything to do with it...
TrackControl[] trackControls = processorForVolume.getTrackControls();
if (trackControls.length == 0)
    throw new MC_Exception("No track controls where found for this device:", new Object[]{device});
for (TrackControl control : trackControls)
    trackManipulator.manipulateTrackControls(control);

// wait until the processor is realized
newState = new ProcessorStateListener(Controller.Realized).waitForProcessorState(processorForVolume);
System.out.println("volumeProcessorState: "+newState);

// receives the gain control
micVolumeController = processorForVolume.getGainControl();

// cannot get the output stream to process further... any suggestions?
processor = Manager.createProcessor(processorForVolume.getDataOutput());
new ProcessorStateListener(Processor.Configured).waitForProcessorState(processor);
processor.setContentDescriptor(DeviceCapturingManager.RAW_RTP);
new ProcessorStateListener(Controller.Realized).waitForProcessorState(processor);

这是它生成的输出:

volumeProcessorState:已配置 格式设置为跟踪控制 - com.sun.media.ProcessEngine$ProcTControl@1627c16: 线性,48000.0 Hz,16 位,立体声, LittleEndian,签名 volumeProcessorState:已实现

处理器输出的数据为Null。

我应该明确一点,当内容描述符 != null 时,我确实得到了一个输出流,但没有音量控制器,当它为 null 时,我得到了控制器,但没有流。

我尝试连接到音频麦克风设备

亚当。

【问题讨论】:

    标签: controller media volume microphone jmf


    【解决方案1】:

    麦克风没有音量组件!必须自己实现。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-03-29
      • 1970-01-01
      • 1970-01-01
      • 2011-10-16
      • 1970-01-01
      • 1970-01-01
      • 2011-09-05
      • 2013-09-18
      相关资源
      最近更新 更多