Exemplo n.º 1
0
        public void AddFrames(short[] aBuffer, uint nSize) // IntPtr pBuffer, int nSiz  short[] aBuffer
        {
            EbuR128Error nRes = CppFunction <Functions.wrap_ebur128_add_frames_short>().Invoke(_pState, aBuffer, nSize);

            if (nRes > 0)
            {
                throw new Exception("wrap_ebur128_add_frames_short returns " + nRes + $" [p={_pState}][buf={(aBuffer == null ? "NULL" : "" + aBuffer.Length)}][siz={nSize}]");
            }
        }
Exemplo n.º 2
0
        public EbuR128(uint nChannels, uint nSamplerate, EbuR128Mode eAnalizeMode)
        {
            EbuR128Error nRes = CppFunction <Functions.wrap_ebur128_init>().Invoke(nChannels, nSamplerate, eAnalizeMode, out _pState);

            if (nRes > 0)
            {
                throw new Exception($"wrap_ebur128_init returns {nRes}");
            }
        }
Exemplo n.º 3
0
        public double GetLufs()
        {
            double       nRetVal;
            EbuR128Error nRes = CppFunction <Functions.wrap_ebur128_loudness_global>().Invoke(_pState, out nRetVal);

            if (nRes > 0)
            {
                throw new Exception("wrap_ebur128_loudness_global returns " + nRes);
            }
            return(nRetVal);
        }
Exemplo n.º 4
0
        public void AddFrames(int[] aBuffer)
        {
            //GCHandle cHandle = GCHandle.Alloc(aBuffer, GCHandleType.Pinned);   //cHandle.AddrOfPinnedObject()

            EbuR128Error nRes = CppFunction <Functions.wrap_ebur128_add_frames_int>().Invoke(_pState, aBuffer, (uint)aBuffer.Length);

            if (nRes > 0)
            {
                throw new Exception("wrap_ebur128_add_frames_int returns " + nRes);
            }
        }