Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions jme3-examples/src/main/java/jme3test/audio/TestMusicPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ public InputStream openStream() {
}

musicSource = new AudioNode(musicData, key);
// A positional AudioNode would prohibit stereo sound!
musicSource.setPositional(false);
musicLength = musicData.getDuration();
updateTime();
}
Expand Down Expand Up @@ -264,18 +266,7 @@ private void btnFFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:e
}//GEN-LAST:event_btnFFActionPerformed

private void sldBarStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_sldBarStateChanged
if (musicSource != null && !sldBar.getValueIsAdjusting()){
curTime = sldBar.getValue() / 100f;
if (curTime < 0)
curTime = 0;

musicSource.setTimeOffset(curTime);
// if (musicSource.getStatus() == Status.Playing){
// musicSource.stop();
// musicSource.play();
// }
updateTime();
}
// do nothing: OGG/Vorbis supports seeking, but only for time = 0!
}//GEN-LAST:event_sldBarStateChanged

/**
Expand Down