Package com.badlogic.gdx.assets.loaders
Class SoundLoader
java.lang.Object
com.badlogic.gdx.assets.loaders.AssetLoader<T,P>
com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader<Sound,SoundLoader.SoundParameter>
com.badlogic.gdx.assets.loaders.SoundLoader
AssetLoader
to load Sound
instances.-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetDependencies
(String fileName, FileHandle file, SoundLoader.SoundParameter parameter) Returns the assets this asset requires to be loaded first.protected Sound
Returns theSound
instance currently loaded by thisSoundLoader
.void
loadAsync
(AssetManager manager, String fileName, FileHandle file, SoundLoader.SoundParameter parameter) Loads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.loadSync
(AssetManager manager, String fileName, FileHandle file, SoundLoader.SoundParameter parameter) Loads the OpenGL part of the asset.Methods inherited from class com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader
unloadAsync
Methods inherited from class com.badlogic.gdx.assets.loaders.AssetLoader
resolve
-
Constructor Details
-
SoundLoader
-
-
Method Details
-
getLoadedSound
Returns theSound
instance currently loaded by thisSoundLoader
. -
loadAsync
public void loadAsync(AssetManager manager, String fileName, FileHandle file, SoundLoader.SoundParameter parameter) Description copied from class:AsynchronousAssetLoader
Loads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.- Specified by:
loadAsync
in classAsynchronousAssetLoader<Sound,
SoundLoader.SoundParameter> fileName
- the name of the asset to loadfile
- the resolved file to loadparameter
- the parameters to use for loading the asset
-
loadSync
public Sound loadSync(AssetManager manager, String fileName, FileHandle file, SoundLoader.SoundParameter parameter) Description copied from class:AsynchronousAssetLoader
Loads the OpenGL part of the asset.- Specified by:
loadSync
in classAsynchronousAssetLoader<Sound,
SoundLoader.SoundParameter> file
- the resolved file to load
-
getDependencies
public Array<AssetDescriptor> getDependencies(String fileName, FileHandle file, SoundLoader.SoundParameter parameter) Description copied from class:AssetLoader
Returns the assets this asset requires to be loaded first. This method may be called on a thread other than the GL thread.- Specified by:
getDependencies
in classAssetLoader<Sound,
SoundLoader.SoundParameter> - Parameters:
fileName
- name of the asset to loadfile
- the resolved file to loadparameter
- parameters for loading the asset- Returns:
- other assets that the asset depends on and need to be loaded first or null if there are no dependencies.
-