Package javax.sound.sampled

Examples of javax.sound.sampled.AudioFileFormat


     * @param input
     * @throws IOException
     * @throws UnsupportedAudioFileException
     */
    protected void loadInfo(InputStream input) throws IOException, UnsupportedAudioFileException {
        AudioFileFormat aff = AudioSystem.getAudioFileFormat(input);
        loadInfo(aff);
    }
View Full Code Here


     * @param file
     * @throws IOException
     * @throws UnsupportedAudioFileException
     */
    protected void loadInfo(File file) throws IOException, UnsupportedAudioFileException {
        AudioFileFormat aff = AudioSystem.getAudioFileFormat(file);
        loadInfo(aff);
    }
View Full Code Here

     * @param input
     * @throws IOException
     * @throws UnsupportedAudioFileException
     */
    protected void loadInfo(URL input) throws IOException, UnsupportedAudioFileException {
        AudioFileFormat aff = AudioSystem.getAudioFileFormat(input);
        loadInfo(aff);
        loadShoutastInfo(aff);
    }
View Full Code Here

        long lFileLengthInBytes = AudioSystem.NOT_SPECIFIED;
        URLConnection conn = url.openConnection();
        // Tell shoucast server (if any) that SPI support shoutcast stream.
        conn.setRequestProperty("Icy-Metadata", "1");
        InputStream inputStream = conn.getInputStream();
        AudioFileFormat audioFileFormat = null;
        try
        {
            audioFileFormat = getAudioFileFormat(inputStream, lFileLengthInBytes);
        }
        finally
View Full Code Here

   try
   {
    if (out != null) out.println("---  Start : "+filename+"  ---");
    File file = new File(filename);
    //URL file = new URL(props.getProperty("shoutcast"));
    AudioFileFormat aff = AudioSystem.getAudioFileFormat(file);
    if (out != null) out.println("Audio Type : "+aff.getType());
    AudioInputStream in= AudioSystem.getAudioInputStream(file);
    AudioInputStream din = null;
    if (in != null)
    {
      AudioFormat baseFormat = in.getFormat();
View Full Code Here

  {
    if (out != null) out.println("-> Filename : "+filename+" <-");
        try
        {
            File file = new File(filename);
            AudioFileFormat aff = AudioSystem.getAudioFileFormat(file);
            AudioInputStream in = AudioSystem.getAudioInputStream(file);
            AudioInputStream din = null;
            AudioFormat baseFormat = in.getFormat();
            if (out != null) out.println("Source Format : "+baseFormat.toString());
            AudioFormat  decodedFormat = new AudioFormat(
View Full Code Here

  {
    if (out!=null) out.println("*** testGetAudioFileFormatFile ***");
    try
    {
      File file = new File(filename);
      AudioFileFormat baseFileFormat= AudioSystem.getAudioFileFormat(file);     
      dumpAudioFileFormat(baseFileFormat,out,file.toString());
      assertEquals("FrameLength",Integer.parseInt((String)props.getProperty("FrameLength")),baseFileFormat.getFrameLength());     
      assertEquals("ByteLength",Integer.parseInt((String)props.getProperty("ByteLength")),baseFileFormat.getByteLength());     
    }
    catch (UnsupportedAudioFileException e)
    {
      assertTrue("testGetAudioFileFormatFile:"+e.getMessage(),false);
    }
View Full Code Here

  {
    if (out!=null) out.println("*** testGetAudioFileFormatURL ***");
    try
    {
      URL url = new URL(fileurl);
      AudioFileFormat baseFileFormat= AudioSystem.getAudioFileFormat(url);     
      dumpAudioFileFormat(baseFileFormat,out,url.toString());
      assertEquals("FrameLength",-1,baseFileFormat.getFrameLength());     
      assertEquals("ByteLength",-1,baseFileFormat.getByteLength());     
    }
    catch (UnsupportedAudioFileException e)
    {
      assertTrue("testGetAudioFileFormatURL:"+e.getMessage(),false);
    }
View Full Code Here

  {
    if (out!=null) out.println("*** testGetAudioFileFormatInputStream ***");
    try
    {
      InputStream in = new BufferedInputStream(new FileInputStream(filename));
      AudioFileFormat baseFileFormat= AudioSystem.getAudioFileFormat(in);     
      dumpAudioFileFormat(baseFileFormat,out,in.toString());
      in.close();
      assertEquals("FrameLength",-1,baseFileFormat.getFrameLength());     
      assertEquals("ByteLength",-1,baseFileFormat.getByteLength());     
    }
    catch (UnsupportedAudioFileException e)
    {
      assertTrue("testGetAudioFileFormatInputStream:"+e.getMessage(),false);
    }
View Full Code Here

                              "mp3.framesize.bytes","mp3.vbr.scale","mp3.version.encoding",
                              "mp3.header.pos","mp3.version.layer","mp3.crc"};
    String[] testPropsAF = {"vbr", "bitrate"};

    File file = new File(filename);
    AudioFileFormat baseFileFormat = null;
    AudioFormat baseFormat = null;
    try
    {
      baseFileFormat = AudioSystem.getAudioFileFormat(file);
      baseFormat = baseFileFormat.getFormat();
      if (out != null) out.println("-> Filename : "+filename+" <-");
      if (out != nullout.println(baseFileFormat);
      if (baseFileFormat instanceof TAudioFileFormat)
      {
        Map properties = ((TAudioFileFormat)baseFileFormat).properties();
View Full Code Here

TOP

Related Classes of javax.sound.sampled.AudioFileFormat

Copyright © 2018 www.massapicom. 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.