Examples of AudioFileFormat


Examples of javax.sound.sampled.AudioFileFormat

     */
    public AudioInputStream getAudioInputStream(InputStream stream) throws UnsupportedAudioFileException, IOException {

        DataInputStream dis = null;
        int headerSize;
        AudioFileFormat fileFormat = null;
        AudioFormat format = null;


        fileFormat = getAudioFileFormat( stream ); // throws UnsupportedAudioFileException, IOException

        // if we passed this call, we have an AU file.

        format = fileFormat.getFormat();

        dis = new DataInputStream(stream);

        // now seek past the header

        dis.readInt(); // magic
        headerSize     = (format.isBigEndian()==true ? dis.readInt() : rllong(dis) );
        dis.skipBytes( headerSize - 8 );


        // we've got everything, and the stream should be at the
        // beginning of the data chunk, so return an AudioInputStream.

        return new AudioInputStream(dis, format, fileFormat.getFrameLength());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.