コード例 #1
0
 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;
 }
コード例 #2
0
 public void Dispose()
 {
     OvMarshal.ov_clear(vfp);
     if (handle_ovf.IsAllocated)
     {
         handle_ovf.Free();
     }
 }
コード例 #3
0
        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);
        }
コード例 #4
0
 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);
 }
コード例 #5
0
        public long GetTotalPcm(int i)
        {
            long ret = OvMarshal.ov_pcm_total(vfp, i);

            return(ret);
        }
コード例 #6
0
        public long TellTime()
        {
            long ret = OvMarshal.ov_time_tell(vfp);

            return(ret);
        }
コード例 #7
0
        public long TellPcm()
        {
            long ret = OvMarshal.ov_pcm_tell(vfp);

            return(ret);
        }
コード例 #8
0
        public long TellRaw()
        {
            long ret = OvMarshal.ov_raw_tell(vfp);

            return(ret);
        }
コード例 #9
0
        public int SeekTime(long pos)
        {
            int ret = OvMarshal.ov_time_seek(vfp, pos);

            return(ret);
        }
コード例 #10
0
        public int SeekPcm(long pos)
        {
            int ret = OvMarshal.ov_pcm_seek(vfp, pos);

            return(ret);
        }
コード例 #11
0
        public int SeekRaw(long pos)
        {
            int ret = OvMarshal.ov_raw_seek(vfp, pos);

            return(ret);
        }
コード例 #12
0
        public long GetTotalTime(int i)
        {
            long ret = OvMarshal.ov_time_total(vfp, i);

            return(ret);
        }
コード例 #13
0
        public long GetTotalRaw(int i)
        {
            long ret = OvMarshal.ov_raw_total(vfp, i);

            return(ret);
        }
コード例 #14
0
        public OggVorbisComment GetComment(int link)
        {
            IntPtr ret = OvMarshal.ov_comment(vfp, link);

            return(new OggVorbisComment(ret, text_encoding));
        }
コード例 #15
0
        public OggVorbisInfo GetInfo(int i)
        {
            IntPtr ret = OvMarshal.ov_info(vfp, i);

            return(new OggVorbisInfo(ret));
        }
コード例 #16
0
        public int GetSerialNumber(int i)
        {
            C_LONG ret = OvMarshal.ov_serialnumber(vfp, i);

            return((int)ret);
        }
コード例 #17
0
        public int GetBitrate(int i)
        {
            C_LONG ret = OvMarshal.ov_bitrate(vfp, i);

            return((int)ret);
        }