private void btnFFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFFActionPerformed if (musicSource.getStatus() == Status.Playing){ musicSource.setPitch(2); } }//GEN-LAST:event_btnFFActionPerformed
private void btnStopActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnStopActionPerformed if (musicSource != null){ musicSource.setPitch(1); ar.stopSource(musicSource); } }//GEN-LAST:event_btnStopActionPerformed
private void btnPlayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPlayActionPerformed if (musicSource == null){ btnOpenActionPerformed(evt); return; } if (musicSource.getStatus() == Status.Playing){ musicSource.setPitch(1); ar.pauseSource(musicSource); }else{ musicSource.setPitch(1); musicSource.play(); } }//GEN-LAST:event_btnPlayActionPerformed
@Override public void simpleInitApp() { flyCam.setMoveSpeed(10); Torus torus = new Torus(10, 6, 1, 3); Geometry g = new Geometry("Torus Geom", torus); g.rotate(-FastMath.HALF_PI, 0, 0); g.center(); g.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m")); // rootNode.attachChild(g); ufoNode = new AudioNode(assetManager, "Sound/Effects/Beep.ogg", AudioData.DataType.Buffer); ufoNode.setLooping(true); ufoNode.setPitch(0.5f); ufoNode.setRefDistance(1); ufoNode.setMaxDistance(100000000); ufoNode.setVelocityFromTranslation(true); ufoNode.play(); Geometry ball = new Geometry("Beeper", new Sphere(10, 10, 0.1f)); ball.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m")); ufoNode.attachChild(ball); rootNode.attachChild(ufoNode); }