Terraria ModLoader  0.11.4
A framework for Terraria mods
Terraria.ModLoader.Audio.MusicStreamingMP3 Class Reference
+ Inheritance diagram for Terraria.ModLoader.Audio.MusicStreamingMP3:
+ Collaboration diagram for Terraria.ModLoader.Audio.MusicStreamingMP3:

Public Member Functions

 MusicStreamingMP3 (string path)
 
override void Reset ()
 
override void Stop (AudioStopOptions options)
 
- Public Member Functions inherited from Terraria.ModLoader.Audio.MusicStreaming
 MusicStreaming (string path)
 
override void CheckBuffer ()
 
void Dispose ()
 
override void Pause ()
 
override void Play ()
 
override void Resume ()
 
override void SetVariable (string name, float value)
 

Protected Member Functions

override void PrepareStream ()
 
- Protected Member Functions inherited from Terraria.ModLoader.Audio.MusicStreaming
virtual void FillBuffer (byte[] buffer)
 

Private Attributes

Stream underlying
 

Additional Inherited Members

- Static Public Member Functions inherited from Terraria.ModLoader.Audio.Music
static implicit operator Music (Cue cue)
 
- Public Attributes inherited from Terraria.ModLoader.Audio.MusicStreaming
override bool IsPaused => instance != null && instance.State == SoundState.Paused
 
override bool IsPlaying => instance != null && instance.State != SoundState.Stopped
 
- Protected Attributes inherited from Terraria.ModLoader.Audio.MusicStreaming
AudioChannels channels
 
int sampleRate
 
Stream stream
 
- Properties inherited from Terraria.ModLoader.Audio.Music
abstract bool IsPaused [get]
 
abstract bool IsPlaying [get]
 

Detailed Description

Definition at line 180 of file MusicWrappers.cs.

Constructor & Destructor Documentation

Terraria.ModLoader.Audio.MusicStreamingMP3.MusicStreamingMP3 ( string  path)

Definition at line 184 of file MusicWrappers.cs.

Member Function Documentation

override void Terraria.ModLoader.Audio.MusicStreamingMP3.PrepareStream ( )
protectedvirtual

Implements Terraria.ModLoader.Audio.MusicStreaming.

Definition at line 186 of file MusicWrappers.cs.

186  {
187  underlying = stream;
188 
189  var mp3Stream = new MP3Stream(stream);
190  sampleRate = mp3Stream.Frequency;
191  channels = (AudioChannels)mp3Stream.ChannelCount;
192  stream = mp3Stream;
193  }
override void Terraria.ModLoader.Audio.MusicStreamingMP3.Reset ( )
virtual

Implements Terraria.ModLoader.Audio.Music.

Definition at line 200 of file MusicWrappers.cs.

200  {
201  if (stream != null) {
202  underlying.Position = 0;
203  //mp3 is not designed to loop and creates static if you just reset the stream due to fourier encoding carryover
204  //if you're really smart, you can make a looping version and PR it
205  stream = new MP3Stream(underlying);
206  }
207  }
override void Terraria.ModLoader.Audio.MusicStreamingMP3.Stop ( AudioStopOptions  options)
virtual

Reimplemented from Terraria.ModLoader.Audio.MusicStreaming.

Definition at line 195 of file MusicWrappers.cs.

195  {
196  base.Stop(options);
197  underlying = null;
198  }

Member Data Documentation

Stream Terraria.ModLoader.Audio.MusicStreamingMP3.underlying
private

Definition at line 182 of file MusicWrappers.cs.