whoops that shouldn't be in there

pull/14/head
cosmonaut 2021-01-20 12:42:36 -08:00
parent 58427b8c90
commit 52b60b66f4
1 changed files with 0 additions and 36 deletions

View File

@ -1,36 +0,0 @@
using System;
using System.IO;
namespace MoonWorks.Audio
{
// for streaming long playback
public class Song
{
public IntPtr Handle { get; }
public FAudio.stb_vorbis_info Info { get; }
public uint BufferSize { get; }
public bool Loop { get; set; }
private readonly float[] buffer;
private const int bufferShrinkFactor = 8;
public TimeSpan Duration { get; set; }
public Song(FileInfo fileInfo)
{
var filePointer = FAudio.stb_vorbis_open_filename(fileInfo.FullName, out var error, IntPtr.Zero);
if (error != 0)
{
throw new AudioLoadException("Error loading file!");
}
Info = FAudio.stb_vorbis_get_info(filePointer);
BufferSize = (uint)(Info.sample_rate * Info.channels) / bufferShrinkFactor;
buffer = new float[BufferSize];
FAudio.stb_vorbis_close(filePointer);
}
}
}