TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ LoadMusic()

static IAudioTrack Terraria.ModLoader.MusicLoader.LoadMusic ( string path,
string extension )
inlinestaticpackage

Definition at line 215 of file MusicLoader.cs.

216 {
217 path = "tmod:" + path + extension;
218 Stream stream = ModContent.OpenRead(path, newFileStream: true);
219 return extension switch
220 {
221 ".wav" => new WAVAudioTrack(stream),
222 ".mp3" => new MP3AudioTrack(stream),
223 ".ogg" => new OGGAudioTrack(stream),
224 _ => throw new ResourceLoadException("Unknown music extension " + extension),
225 };
226 }

References Terraria.ModLoader.ModContent.OpenRead().

Referenced by Terraria.ModLoader.MusicLoader.GetMusic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: