* Added new constructor for AudioNode that accepts stream-cache parameter

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7519 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
Sha..rd 14 years ago
parent 873c656e23
commit c91d1d264a
  1. 24
      engine/src/core/com/jme3/audio/AudioNode.java

@ -104,6 +104,9 @@ public class AudioNode extends Node {
Stopped, Stopped,
} }
/**
* Serialization only. Do not use.
*/
public AudioNode() { public AudioNode() {
} }
@ -139,12 +142,29 @@ public class AudioNode extends Node {
* @param name The filename of the audio file * @param name The filename of the audio file
* @param stream If true, the audio will be streamed gradually from disk, * @param stream If true, the audio will be streamed gradually from disk,
* otherwise, it will be buffered. * otherwise, it will be buffered.
* @param streamCache If stream is also true, then this specifies if
* the stream cache is used. When enabled, the audio stream will
* be read entirely but not decoded, allowing features such as
* seeking, looping and determining duration.
*/ */
public AudioNode(AudioRenderer audioRenderer, AssetManager assetManager, String name, boolean stream) { public AudioNode(AudioRenderer audioRenderer, AssetManager assetManager, String name, boolean stream, boolean streamCache) {
this(audioRenderer); this(audioRenderer);
this.key = new AudioKey(name, stream); this.key = new AudioKey(name, stream, streamCache);
this.data = (AudioData) assetManager.loadAsset(key); this.data = (AudioData) assetManager.loadAsset(key);
} }
/**
* Creates a new <code>AudioNode</code> with the given audio file.
*
* @param audioRenderer The audio renderer to use for playing. Cannot be null.
* @param assetManager The asset manager to use to load the audio file
* @param name The filename of the audio file
* @param stream If true, the audio will be streamed gradually from disk,
* otherwise, it will be buffered.
*/
public AudioNode(AudioRenderer audioRenderer, AssetManager assetManager, String name, boolean stream) {
this(audioRenderer, assetManager, name, stream, false);
}
/** /**
* Creates a new <code>AudioNode</code> with the given audio file. * Creates a new <code>AudioNode</code> with the given audio file.

Loading…
Cancel
Save