Terraria ModLoader  0.11.8.3
A mod to make and play Terraria mods
Terraria.ModLoader.Audio.MusicStreamingWAV Class Reference
+ Inheritance diagram for Terraria.ModLoader.Audio.MusicStreamingWAV:
+ Collaboration diagram for Terraria.ModLoader.Audio.MusicStreamingWAV:

Public Member Functions

 MusicStreamingWAV (string path)
 
override void Reset ()
 
- 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)
 
override void Stop (AudioStopOptions options)
 

Protected Member Functions

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

Private Attributes

long dataStart = -1
 

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 139 of file MusicWrappers.cs.

Constructor & Destructor Documentation

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

Definition at line 143 of file MusicWrappers.cs.

Member Function Documentation

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

Implements Terraria.ModLoader.Audio.MusicStreaming.

Definition at line 145 of file MusicWrappers.cs.

145  {
146  if (dataStart >= 0) {
147  stream.Position = dataStart;
148  return;
149  }
150 
151  var reader = new BinaryReader(stream);
152  int chunkID = reader.ReadInt32();
153  int fileSize = reader.ReadInt32();
154  int riffType = reader.ReadInt32();
155  int fmtID = reader.ReadInt32();
156  int fmtSize = reader.ReadInt32();
157  int fmtCode = reader.ReadInt16();
158  channels = (AudioChannels)reader.ReadInt16();
159  sampleRate = reader.ReadInt32();
160  int fmtAvgBPS = reader.ReadInt32();
161  int fmtBlockAlign = reader.ReadInt16();
162  int bitDepth = reader.ReadInt16();
163 
164  if (fmtSize == 18) {
165  // Read any extra values
166  int fmtExtraSize = reader.ReadInt16();
167  reader.ReadBytes(fmtExtraSize);
168  }
169 
170  int dataID = reader.ReadInt32();
171  int dataSize = reader.ReadInt32();
172  dataStart = stream.Position;
173  }
override void Terraria.ModLoader.Audio.MusicStreamingWAV.Reset ( )
virtual

Implements Terraria.ModLoader.Audio.Music.

Definition at line 175 of file MusicWrappers.cs.

175  {
176  if (stream != null)
177  stream.Position = dataStart;
178  }

Member Data Documentation

long Terraria.ModLoader.Audio.MusicStreamingWAV.dataStart = -1
private

Definition at line 141 of file MusicWrappers.cs.