Terraria ModLoader  0.11.8
A mod to make and play 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 181 of file MusicWrappers.cs.

Constructor & Destructor Documentation

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

Definition at line 185 of file MusicWrappers.cs.

Member Function Documentation

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

Implements Terraria.ModLoader.Audio.MusicStreaming.

Definition at line 187 of file MusicWrappers.cs.

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

Implements Terraria.ModLoader.Audio.Music.

Definition at line 201 of file MusicWrappers.cs.

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

Reimplemented from Terraria.ModLoader.Audio.MusicStreaming.

Definition at line 196 of file MusicWrappers.cs.

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

Member Data Documentation

Stream Terraria.ModLoader.Audio.MusicStreamingMP3.underlying
private

Definition at line 183 of file MusicWrappers.cs.