Erro do protocolo RTP

Pessoal , este código recebe som do microfone e envia pra um arquivo , sem fechar o arquivo eu tento mandar via RTP , mas tá retornando erro no método createSendStream (no final do código) , não consegui decifrar o motivo .


import javax.swing.*; 

import java.awt.*; 
import java.awt.event.*; 

import java.io.*; 
import java.util.*; 
import java.net.*; 

import javax.media.*; 
import javax.media.protocol.*; 
import javax.media.format.*; 
import javax.media.control.*; 
import javax.media.rtp.*; 
import javax.media.rtp.event.*; 

public class CapturaSom3 extends JFrame implements ActionListener { 
private JPanel painel = new JPanel(); 
private JPanel botoes = new JPanel(); 

private JButton gravar = new JButton("Gravar"); 
private JButton parar = new JButton("Finalizar"); 

private DataSink entrada = null; 

private Processor processador, processador1; 

private DataSource voz, arquivo, enviando; 

private DataSource devices = null; 

private Format formato[],formatos[]; 

private FormatControl controle[] = null; 

private AudioFormat foratoAudio = null; 

private CaptureDeviceInfo informacoes = null; 

private Component componente = null; 

private MediaLocator local = null; 

private MonitorControl monitor = null; 

private FileTypeDescriptor tipoArquivo = null; 

private Vector dispositivos = new Vector(); 

private Date hora = new Date(); 

private File grava = null; 

private RTPManager[] rtpManager = null; 

private TrackControl[] trilha = null; 

private SendStream enviandoStream = null; 

private SessionAddress localAddr, remotoAddr = null; 

private String enderecoDest = "127.0.0.1"; 

private InetAddress endereco = null; 

private int porta = 2020; 

public CapturaSom3() { 
super("Captura Som"); 

gravar.addActionListener(this); 
gravar.setMnemonic('a'); 
gravar.setToolTipText("Inicia o envio da voz"); 

parar.addActionListener(this); 
parar.setMnemonic('i'); 
parar.setToolTipText("Finaliza a converça"); 

botoes.setLayout(new FlowLayout()); 

botoes.add(gravar); botoes.add(parar); 

grava = new File("c:\\arquivo"+hora.getHours()+hora.getMinutes()+".mpeg"); 

super.add(botoes); 

super.setDefaultCloseOperation(EXIT_ON_CLOSE); 
super.setVisible(true); 
super.pack(); 

} 

public void actionPerformed(ActionEvent ae){ 
if(ae.getSource().equals(gravar)){ 
try{ 

dispositivos = CaptureDeviceManager.getDeviceList(null); 

informacoes = (CaptureDeviceInfo) dispositivos.elementAt(1); 

formato = informacoes.getFormats(); 

voz = Manager.createDataSource(informacoes.getLocator()); 

controle = ((CaptureDevice)voz).getFormatControls(); 

for(int i = 0; i< controle.length; i++){ 
controle[i].setFormat(formato[1]); 
} 

formatos = new Format[1]; 

formatos[0] = formato[1]; 

tipoArquivo = new FileTypeDescriptor(FileTypeDescriptor.MPEG_AUDIO); 

processador = Manager.createRealizedProcessor(new ProcessorModel(voz, formatos, tipoArquivo)); 

processador.configure(); 

arquivo = processador.getDataOutput(); 

if(arquivo != null){ 

local = new MediaLocator(grava.toURL()); 

entrada = Manager.createDataSink(arquivo,local); 

entrada.open(); 

entrada.start(); 

}else{ 

System.out.println("Arquivo = null"); 

} 

processador.start(); 

monitor = (MonitorControl) processador.getControl("javax.media.control.MonitorControl"); 

componente = monitor.getControlComponent(); 
int x = 0; 
while(x < 200){ 
x++; 
System.out.println(x); 

if(x == 199){ 
envia(); 
} 
} 

}catch(NoDataSourceException ndse){ 

System.err.println("Probrlmas no DataSource: "+ndse.getMessage()); 

}catch(IOException ioe){ 

System.err.println("Problema de entrada e saida: "+ioe.getMessage()); 

}catch(CannotRealizeException cre){ 

System.err.println("Problemas na realização do processo: "+cre.getMessage()); 

}catch(NoProcessorException npe){ 

System.err.println("Problemas com o processador: "+npe.getMessage()); 

}catch(NoDataSinkException ndse){ 

System.err.println("Problemas: "+ndse.getMessage()); 

}catch(SecurityException se){ 

System.err.println("Problemas de segurança no DataSink: "+se.getMessage()); 

} 

} 

if(ae.getSource().equals(parar)){ 


entrada.close(); 

processador.close(); 




System.out.println("Parando o Processador."); 
} 

} 

public void envia(){ 
try{ 
processador1 = Manager.createProcessor(local); 

processador1.configure();

processador1.setContentDescriptor(new ContentDescriptor(ContentDescriptor.RAW_RTP)); 

trilha = processador1.getTrackControls(); 

Format[] formatoRTP = null; 

for(int i = 0; i < trilha.length; i++){ 

if(trilha[i].isEnabled()){ 

formatoRTP = trilha[i].getSupportedFormats(); 

if(formatoRTP.length > 0){ 

for(int j = 0; j < formatoRTP.length; j++){ 

trilha[i].setFormat(formatoRTP[j]); 

} 

}else{ 

System.err.println("Deu mais erro."); 

} 

} 


} 

rtpManager = new RTPManager[trilha.length]; 

for(int k = 0; k < trilha.length; k++){ 

rtpManager[k] = RTPManager.newInstance(); 

porta += (2*k); 

endereco = InetAddress.getByName(enderecoDest); 

localAddr = new SessionAddress(endereco.getLocalHost(), porta); 

remotoAddr = new SessionAddress(endereco, porta); 

rtpManager[k].initialize(localAddr); 

rtpManager[k].addTarget(remotoAddr); 

enviandoStream = rtpManager[k].createSendStream(arquivo,k); 

enviandoStream.start(); 

System.out.println("ENVIANDO");

} 
processador1.realize(); 

enviando = processador1.getDataOutput(); 

if(enviando == null){ 
System.err.println("Erro, Erro, Erro... :'("); 
} 


}catch(NoProcessorException npe){ 
System.err.println("Erro no Processor; "+npe.getMessage()); 
}catch(UnknownHostException ukhe){ 
System.err.println("Erro na resoluçao de nome; "+ukhe.getMessage()); 
}catch(InvalidSessionAddressException isae){ 
System.err.println("Erro no initialize; "+isae.getMessage()); 
}catch(UnsupportedFormatException usfe){ 
System.err.println("Formato não suportado; "+usfe.getMessage()); 
}catch(IOException ioe){ 
System.err.println("erro de I/O; "+ioe.getMessage()); 
} 

} 

public static void main(String[] args) { 

new CapturaSom3(); 

} 

} 

O erro é este:

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: com.sun.med
ia.multiplexer.BasicMux$BasicMuxDataSource cannot be cast to javax.media.protoco
l.PushBufferDataSource
        at com.sun.media.rtp.RTPSessionMgr.createSendStream(RTPSessionMgr.java:1
098)
        at com.sun.media.rtp.RTPSessionMgr.createSendStream(RTPSessionMgr.java:1
262)
        at CapturaSom3.envia(CapturaSom3.java:261)
        at CapturaSom3.actionPerformed(CapturaSom3.java:153)
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
        at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
        at java.awt.Component.processMouseEvent(Unknown Source)
        at javax.swing.JComponent.processMouseEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)
        at java.awt.Container.processEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)

Se puderem me ajudar…

Obrigado,

Raphael.