Beispiel #1
0
        // Token: 0x0600015E RID: 350 RVA: 0x0000476C File Offset: 0x0000296C
        public unsafe static int OpusDecode(IntPtr decoder, int frameSize, Span <byte> pcm)
        {
            int num;

            fixed(byte *pinnableReference = pcm.GetPinnableReference())
            {
                byte *data = pinnableReference;

                num = Interop._OpusDecode(decoder, null, 0, data, frameSize, 1);
            }

            if (num < 0)
            {
                OpusError opusError = (OpusError)num;
                throw new Exception(string.Format("Could not decode PCM data from Opus: {0} ({1}).", opusError, (int)opusError));
            }
            return(num);
        }
Beispiel #2
0
        // Token: 0x0600015D RID: 349 RVA: 0x000046FC File Offset: 0x000028FC
        public unsafe static int OpusDecode(IntPtr decoder, ReadOnlySpan <byte> opus, int frameSize, Span <byte> pcm, bool useFec)
        {
            int num;

            fixed(byte *pinnableReference = opus.GetPinnableReference())
            {
                byte *opusData = pinnableReference;

                fixed(byte *pinnableReference2 = pcm.GetPinnableReference())
                {
                    byte *data = pinnableReference2;

                    num = Interop._OpusDecode(decoder, opusData, opus.Length, data, frameSize, useFec ? 1 : 0);
                }
            }

            if (num < 0)
            {
                OpusError opusError = (OpusError)num;
                throw new Exception(string.Format("Could not decode PCM data from Opus: {0} ({1}).", opusError, (int)opusError));
            }
            return(num);
        }