Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8076990

AudioInputStream.close() not releasing resources hook

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 7u76
    • client-libs

      FULL PRODUCT VERSION :
      java version "1.7.0_45"
      Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
      Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Tested it in windows 7, 8, 8.1.

      A DESCRIPTION OF THE PROBLEM :
      trying to convert *.wav audio file to specific *.wav file.

      try (AudioInputStream sias = AudioSystem.getAudioInputStream(mediaFileToConvert)) {

      AudioFormat newFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 8000f, 16, 1, 2, 8000f, false);
      AudioInputStream convert1AIS = AudioSystem.getAudioInputStream(newFormat, sias);

      AudioSystem.write(convert1AIS, AudioFileFormat.Type.WAVE, saveConvertedFilelocalDest);

      convert1AIS.close();
      }

      while trying to delete mediaFileToConvert giving no error but not deleting file. even unable to delete manually


      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      System.gc();

            pardesha Pardeep Sharma
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: