public static OggVorbisMemoryStream LoadFromFile(string filename) { //load from file OggVorbisFileStream fileStream = new OggVorbisFileStream(filename); VorbisInfo ninfo = fileStream.Info; //read to memory byte[] nbuffer = new byte[fileStream.Length]; //fileStream.Read(nbuffer, 0, nbuffer.Length); nbuffer = ReadWholeArray(fileStream, nbuffer); OggVorbisMemoryStream memoryStream = new OggVorbisMemoryStream(nbuffer, ninfo, fileStream.RawLength, fileStream.Duration); //clean up fileStream.Close(); return(memoryStream); }
public static OggVorbisMemoryStream LoadFromFile(string filename) { //load from file OggVorbisFileStream fileStream = new OggVorbisFileStream(filename); VorbisInfo ninfo = fileStream.Info; //read to memory byte[] nbuffer = new byte[fileStream.Length]; //fileStream.Read(nbuffer, 0, nbuffer.Length); nbuffer = ReadWholeArray(fileStream, nbuffer); OggVorbisMemoryStream memoryStream = new OggVorbisMemoryStream(nbuffer, ninfo, fileStream.RawLength, fileStream.Duration); //clean up fileStream.Close(); return memoryStream; }