Ignore:
Timestamp:
2009-06-21T12:02:15+02:00 (15 years ago)
Author:
stoecker
Message:

fixed audio handling a bit

Location:
trunk/src/org/openstreetmap/josm/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/AudioPlayer.java

    r1245 r1685  
    190190        } catch (Exception ex) {
    191191            return null;
     192        }
     193    }
     194
     195    public static void reset() {
     196        if(audioPlayer != null)
     197        {
     198            try {
     199                pause();
     200            } catch(Exception e) {}
     201            audioPlayer.playingUrl = null;
    192202        }
    193203    }
  • trunk/src/org/openstreetmap/josm/tools/AudioUtil.java

    r1677 r1685  
    1212import org.openstreetmap.josm.Main;
    1313
    14 
    1514/**
    1615 * Returns calibrated length of recording in seconds.
     
    2019 */
    2120public class AudioUtil {
    22 
    2321    static public double getCalibratedDuration(File wavFile) {
    2422        try {
    2523            AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(
    26                     new URL("file:".concat(wavFile.getAbsolutePath())));
     24                new URL("file:".concat(wavFile.getAbsolutePath())));
    2725            AudioFormat audioFormat = audioInputStream.getFormat();
    2826            long filesize = wavFile.length();
Note: See TracChangeset for help on using the changeset viewer.