Skip to Main Content

Embedded Technologies

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

audio invalid encoding

843849Apr 7 2008 — edited Apr 7 2008
Hi!
I want to run all au files but only the ones which have the proporties below are allowed:
ulaw,8000,8,signed,big endian,mono
How can i change this state?

I suppose, ok, I use this format then...But I can't convert any file to this format.
 AudioFormat newFormat = new AudioFormat(
                     AudioFormat.Encoding.PCM_SIGNED, 8000 8,
                     1,2,8000
                    true);
             AudioInputStream newStream = AudioSystem.getAudioInputStream(newFormat, audioInputStream);
           audioFormat = newFormat;
          audioInputStream = newStream;
            
           AudioSystem.write(audioInputStream,AudioFileFormat.Type.AU, fout);
The error:
java.lang.IllegalArgumentException: Unsupported conversion: ULAW 8000.0 Hz, 8 bit, mono, 2 bytes/frame, from PCM_SIGNED 8000.0 Hz, 8 bit, mono, 1 bytes/frame,

at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:955)

How can i solve this problem?Thanks...

Edited by: abouttechnology on Apr 7, 2008 1:56 PM

Edited by: abouttechnology on Apr 7, 2008 1:57 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 5 2008
Added on Apr 7 2008
0 comments
223 views