Package org.xbup.library.audio.wave

Examples of org.xbup.library.audio.wave.XBWave


        return false;
//        return imageArea.isEditable();
    }

    public void loadFromFile() {
        XBWave wave = new XBWave();
        wave.loadFromFile(new File(getFileName()));
        wavePanel.setWave(wave);
        targetFormat = wavePanel.getWave().getAudioFormat();
        targetDataLineInfo = new DataLine.Info(SourceDataLine.class,wavePanel.getWave().getAudioFormat());
        audioInputStream = wavePanel.getWave().getAudioInputStream();
       
View Full Code Here


//            textArea.setForeground(dlg.getMyColor());
        }
    }

    public String getCurrentPosition() {
        XBWave wave = wavePanel.getWave();
        if (wave == null) return "0:00.00";
        Point point = getMousePosition();
        if (point == null) point = new Point(scrollPane.getHorizontalScrollBar().getValue(),0);
        float sampleRate = wave.getAudioFormat().getSampleRate();
        float position = point.x / sampleRate;
        String sub = String.valueOf((long) ((position-Math.floor(position))*100));
        if (sub.length()<2) sub = "0" + sub;
        String sec = String.valueOf(((long) position) % 60);
        if (sec.length()<2) sec = "0" + sec;
View Full Code Here

TOP

Related Classes of org.xbup.library.audio.wave.XBWave

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.