Examples of AudioInputStream


Examples of javax.sound.sampled.AudioInputStream

    public void testPlay(String filename) throws UnsupportedAudioFileException, IOException, LineUnavailableException {

        File file = new File(filename);
        // Get AudioInputStream from given file.
        AudioInputStream in = AudioSystem.getAudioInputStream(file);
        AudioInputStream din = null;
        if (in != null) {
            AudioFormat baseFormat = in.getFormat();
            System.out.println(in.getFormat());
            AudioFormat decodedFormat = new AudioFormat(
                    AudioFormat.Encoding.PCM_SIGNED,
View Full Code Here

Examples of javax.sound.sampled.AudioInputStream

    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();
      if (out != null) out.println("Source Format : "+baseFormat.toString());
      AudioFormat  decodedFormat = new AudioFormat(
View Full Code Here

Examples of javax.sound.sampled.AudioInputStream

    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(
                  AudioFormat.Encoding.PCM_SIGNED,
                  baseFormat.getSampleRate(),
View Full Code Here

Examples of javax.sound.sampled.AudioInputStream

  {
    if (out!=null) out.println("*** testGetAudioInputStreamInputStream ***");
    try
    {
      InputStream fin = new BufferedInputStream(new FileInputStream(filename));
      AudioInputStream in= AudioSystem.getAudioInputStream(fin);   
      dumpAudioInputStream(in,out,fin.toString());
      assertEquals("FrameLength",-1,in.getFrameLength());     
      assertEquals("Available",Integer.parseInt((String)props.getProperty("Available")),in.available());     
      fin.close();
      in.close();
    }
    catch (UnsupportedAudioFileException e)
    {
      assertTrue("testGetAudioInputStreamInputStream:"+e.getMessage(),false);
    }
View Full Code Here

Examples of javax.sound.sampled.AudioInputStream

  {
    if (out!=null) out.println("*** testGetAudioInputStreamFile ***");
    try
    {
      File file = new File(filename);
      AudioInputStream in= AudioSystem.getAudioInputStream(file);
      dumpAudioInputStream(in,out,file.toString());
      assertEquals("FrameLength",-1,in.getFrameLength());     
      assertEquals("Available",Integer.parseInt((String)props.getProperty("Available")),in.available());
      in.close();   
    }
    catch (UnsupportedAudioFileException e)
    {
      assertTrue("testGetAudioInputStreamFile:"+e.getMessage(),false);
    }
View Full Code Here

Examples of javax.sound.sampled.AudioInputStream

  {
    if (out!=null) out.println("*** testGetAudioInputStreamURL ***");
    try
    {
      URL url = new URL(fileurl);
      AudioInputStream in= AudioSystem.getAudioInputStream(url);   
      dumpAudioInputStream(in,out,url.toString());
      assertEquals("FrameLength",-1,in.getFrameLength());     
      assertEquals("Available",Integer.parseInt((String)props.getProperty("Available")),in.available());
      in.close();
    }
    catch (UnsupportedAudioFileException e)
    {
      assertTrue("testGetAudioInputStreamURL:"+e.getMessage(),false);
    }
View Full Code Here

Examples of javax.sound.sampled.AudioInputStream

     */
    private void play(Project project, File file, int loops, Long duration) {

        Clip audioClip = null;

        AudioInputStream audioInputStream = null;


        try {
            audioInputStream = AudioSystem.getAudioInputStream(file);
        } catch (UnsupportedAudioFileException uafe) {
            project.log("Audio format is not yet supported: "
                + uafe.getMessage());
        } catch (IOException ioe) {
            ioe.printStackTrace();
        }

        if (audioInputStream != null) {
            AudioFormat format = audioInputStream.getFormat();
            DataLine.Info   info = new DataLine.Info(Clip.class, format,
                                             AudioSystem.NOT_SPECIFIED);
            try {
                audioClip = (Clip) AudioSystem.getLine(info);
                audioClip.addLineListener(this);
View Full Code Here

Examples of javax.sound.sampled.AudioInputStream

      {
        throw new IOException("ResourceNotFoundException: check the correct " +
                              "input file location");
      }
   
    AudioInputStream audioInputStream = null
    if (stream)
      {
        audioInputStream =
          AudioSystem.getAudioInputStream(new FileInputStream(file));
      }
View Full Code Here

Examples of javax.sound.sampled.AudioInputStream

    this.harness.checkPoint("testWav()");
    
    try
      {
        this.harness.checkPoint("testWav() - FILE");
        AudioInputStream audioInputStream = getAudioStream(WAV, false);
       
        processWaveStream(audioInputStream);
       
        this.harness.checkPoint("testWav() - STREAM");
        AudioInputStream audioInputStream2 = getAudioStream(WAV, true);
       
        processWaveStream(audioInputStream2);
      }
    catch (UnsupportedAudioFileException e)
      {
View Full Code Here

Examples of javax.sound.sampled.AudioInputStream

    this.harness.checkPoint("testAU()");
   
    try
      {
        this.harness.checkPoint("testAU() - FILE");
        AudioInputStream audioInputStream = getAudioStream(AU, false);
     
        processAUStream(audioInputStream);
     
        this.harness.checkPoint("testAU() - STREAM");
        AudioInputStream audioInputStream2 = getAudioStream(AU, true);
     
        processAUStream(audioInputStream2);
      }
    catch (UnsupportedAudioFileException e)
      {
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.