/** * Get the AudioInputStream for the current selection * * @see com.groovemanager.sampled.AudioPlayerProvider#getAudioInputStream() */ public AudioInputStream getAudioInputStream() throws NotReadyException { Selection sel = waveDisplay.getSelection(); lastStart = sel.getLeft(); if (lastStart >= cutList.getLength()) lastStart = 0; int right = sel.getRight(); if (right > cutList.getLength()) right = cutList.getLength(); if (lastStart == right) return cutList.getAudioInputStream(lastStart, cutList.getLength() - right); else return cutList.getAudioInputStream(lastStart, right - lastStart); }
/** * Get the whole AudioInputStream from this WaveTab´s audio data independent of its selection * * @return The AudioInputStream for all of this WaveTab´s audio data * @throws NotReadyException If no audio data can be provided at the moment */ public AudioInputStream getWholeAudioInputStream() throws NotReadyException { return cutList.getAudioInputStream(0, cutList.getLength()); }