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

◆ TestAudioSupport()

static bool Terraria.Audio.SoundEngine.TestAudioSupport ( )
inlinestaticprivate

Definition at line 176 of file SoundEngine.cs.

177 {
178 byte[] buffer = new byte[166]
179 {
180 82, 73, 70, 70, 158, 0, 0, 0, 87, 65,
181 86, 69, 102, 109, 116, 32, 16, 0, 0, 0,
182 1, 0, 1, 0, 68, 172, 0, 0, 136, 88,
183 1, 0, 2, 0, 16, 0, 76, 73, 83, 84,
184 26, 0, 0, 0, 73, 78, 70, 79, 73, 83,
185 70, 84, 14, 0, 0, 0, 76, 97, 118, 102,
186 53, 54, 46, 52, 48, 46, 49, 48, 49, 0,
187 100, 97, 116, 97, 88, 0, 0, 0, 0, 0,
188 126, 4, 240, 8, 64, 13, 95, 17, 67, 21,
189 217, 24, 23, 28, 240, 30, 94, 33, 84, 35,
190 208, 36, 204, 37, 71, 38, 64, 38, 183, 37,
191 180, 36, 58, 35, 79, 33, 1, 31, 86, 28,
192 92, 25, 37, 22, 185, 18, 42, 15, 134, 11,
193 222, 7, 68, 4, 196, 0, 112, 253, 86, 250,
194 132, 247, 6, 245, 230, 242, 47, 241, 232, 239,
195 25, 239, 194, 238, 231, 238, 139, 239, 169, 240,
196 61, 242, 67, 244, 180, 246
197 };
198 try
199 {
201 SoundEffect.FromStream(stream);
202 }
203 catch (NoAudioHardwareException)
204 {
205 Console.WriteLine("No audio hardware found. Disabling all audio.");
206 return false;
207 }
208 catch
209 {
210 return false;
211 }
212 return true;
213 }
static void WriteLine()
Definition Console.cs:733

References System.buffer, System.stream, and System.Console.WriteLine().

Referenced by Terraria.Audio.SoundEngine.Initialize().