public OggStreamBuffer(string path, Encoding textEncoding) { text_encoding = textEncoding; OvMarshal.ov_open(OvMarshal.fopen(path, "r"), ref vorbis_file, IntPtr.Zero, 0); handle_ovf = GCHandle.Alloc(vorbis_file, GCHandleType.Pinned); callbacks = vorbis_file.Callbacks; }
public void Dispose() { OvMarshal.ov_clear(vfp); if (handle_ovf.IsAllocated) { handle_ovf.Free(); } }
public long Read(byte [] buffer, C_INT index, C_INT length, ref int bitStream) { long ret = 0; unsafe { fixed(byte *bufptr = buffer) ret = OvMarshal.ov_read(vfp, (IntPtr)(bufptr + index), length, ref bitStream); } return(ret); }
public OggStreamBuffer(Stream stream, Encoding textEncoding) { this.stream = stream; text_encoding = textEncoding; read = new OvReadFunc(Read); seek = new OvSeekFunc(Seek); close = new OvCloseFunc(Close); tell = new OvTellFunc(Tell); callbacks = new OvCallbacks(read, seek, close, tell); OvMarshal.ov_open_callbacks(new IntPtr(1), ref vorbis_file, IntPtr.Zero, 0, callbacks); handle_ovf = GCHandle.Alloc(vorbis_file, GCHandleType.Pinned); }
public long GetTotalPcm(int i) { long ret = OvMarshal.ov_pcm_total(vfp, i); return(ret); }
public long TellTime() { long ret = OvMarshal.ov_time_tell(vfp); return(ret); }
public long TellPcm() { long ret = OvMarshal.ov_pcm_tell(vfp); return(ret); }
public long TellRaw() { long ret = OvMarshal.ov_raw_tell(vfp); return(ret); }
public int SeekTime(long pos) { int ret = OvMarshal.ov_time_seek(vfp, pos); return(ret); }
public int SeekPcm(long pos) { int ret = OvMarshal.ov_pcm_seek(vfp, pos); return(ret); }
public int SeekRaw(long pos) { int ret = OvMarshal.ov_raw_seek(vfp, pos); return(ret); }
public long GetTotalTime(int i) { long ret = OvMarshal.ov_time_total(vfp, i); return(ret); }
public long GetTotalRaw(int i) { long ret = OvMarshal.ov_raw_total(vfp, i); return(ret); }
public OggVorbisComment GetComment(int link) { IntPtr ret = OvMarshal.ov_comment(vfp, link); return(new OggVorbisComment(ret, text_encoding)); }
public OggVorbisInfo GetInfo(int i) { IntPtr ret = OvMarshal.ov_info(vfp, i); return(new OggVorbisInfo(ret)); }
public int GetSerialNumber(int i) { C_LONG ret = OvMarshal.ov_serialnumber(vfp, i); return((int)ret); }
public int GetBitrate(int i) { C_LONG ret = OvMarshal.ov_bitrate(vfp, i); return((int)ret); }