From c91d1d264a01f9ab243649ed84291d29c2506ce6 Mon Sep 17 00:00:00 2001 From: "Sha..rd" Date: Sun, 22 May 2011 17:17:52 +0000 Subject: [PATCH] * 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 --- engine/src/core/com/jme3/audio/AudioNode.java | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/engine/src/core/com/jme3/audio/AudioNode.java b/engine/src/core/com/jme3/audio/AudioNode.java index 708e5c388..3f53614f9 100644 --- a/engine/src/core/com/jme3/audio/AudioNode.java +++ b/engine/src/core/com/jme3/audio/AudioNode.java @@ -104,6 +104,9 @@ public class AudioNode extends Node { Stopped, } + /** + * Serialization only. Do not use. + */ public AudioNode() { } @@ -139,12 +142,29 @@ public class AudioNode extends Node { * @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. + * @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.key = new AudioKey(name, stream); + this.key = new AudioKey(name, stream, streamCache); this.data = (AudioData) assetManager.loadAsset(key); } + + /** + * Creates a new AudioNode 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 AudioNode with the given audio file.