Hello -

My application involves some digital audio processing and hence the sound cannot be 
stored in a file but rather must be a stream. I have tried many techniques, to get the 
input stream MediContainer to work, including the following:

  File soundData = new File( "running.au" );
  try {
    //m_EngineMedia = new MediaContainer( soundData.toURL() );
    audioStream = AudioSystem.getAudioInputStream(soundData);
    System.out.println( "AudioInputStream: " + audioStream.toString() );
    m_EngineMedia = new MediaContainer( audioStream );
    m_EngineMedia.setCacheEnable(true);
    m_EngineMedia.setCapability(MediaContainer.ALLOW_CACHE_READ );
    m_EngineMedia.setCapability(MediaContainer.ALLOW_CACHE_WRITE );
    m_EngineMedia.setCapability(MediaContainer.ALLOW_URL_READ );
    m_EngineMedia.setCapability(MediaContainer.ALLOW_URL_WRITE );
  }
  catch( MalformedURLException e )
  {
    System.out.println( "ERROR: " + e.toString() );
  }
  catch( UnsupportedAudioFileException UE )
  {
    System.out.println( "ERROR: " + UE.toString() );
  }
  catch( IOException IOE )
  {
    System.out.println( "ERROR: " + IOE.toString() );
  }

Every attempt at using a stream results in the following runtime error:

javax.media.j3d.SoundException: null: Sound source data could not be loaded
 at javax.media.j3d.SoundScheduler.attachSoundData(SoundScheduler.java:2675)
 at javax.media.j3d.SoundScheduler.processSoundAtom(SoundScheduler.java:1285)
 at javax.media.j3d.SoundScheduler.calcSchedulingAction(SoundScheduler.java:1577)
 at javax.media.j3d.SoundScheduler.renderChanges(SoundScheduler.java:787)
 at javax.media.j3d.SoundScheduler.processMessages(SoundScheduler.java:229)
 at javax.media.j3d.StructureUpdateThread.doWork(StructureUpdateThread.java:83)
 at javax.media.j3d.J3dThread.run(J3dThread.java:256)

I have tried many variations, but nothing works. Has anybody out there been successful 
in implementing a stream based MediaContainer ?

Thank you.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to