Example #1
0
        public unsafe int initDRM(
            IntPtr hDecoder,
            Int32 sampleRate,
            byte channels
            )
        {
            try
            {
                int result = libfaadCalls.NeAACDecInitDRM(hDecoder,
                                                          sampleRate,
                                                          channels);
                if (result != 0)
                {
                    string s = string.Format("Error initializing decoder library: {0}", "");
                    // NeAACDecGetErrorMessage(init_result));
                }
                PInvoke_libfaad2.configuration *pcfg = (PInvoke_libfaad2.configuration *)libfaadCalls.NeAACDecGetCurrentConfiguration(hDecoder);
                byte b = pcfg->defObjectType;

                return(result);
            }
            catch (Exception ex)
            {
                logger.LogCritical(ex, null, null);
                throw;
            }
        }
Example #2
0
        public unsafe int init(
            IntPtr hDecoder,
            byte[] buffer,
            ref Int32 sampleRate,
            ref byte channels
            )
        {
#if AAC_TEST
            fs = new FileStream(aactestpath, FileMode.Create);
#endif

            try
            {
                fixed(byte *p = &buffer[0])
                {
                    int result = libfaadCalls.NeAACDecInit(hDecoder,
                                                           p,
                                                           buffer.Length,
                                                           ref sampleRate,
                                                           ref channels,
                                                           1); //1: 960 bytes frame length, mandatory for DAB

                    if (result != 0)
                    {
                        string s = string.Format("Error initializing decoder library: {0}", "");
                        // NeAACDecGetErrorMessage(init_result));
                    }
                    PInvoke_libfaad2.configuration *pcfg = (PInvoke_libfaad2.configuration *)libfaadCalls.NeAACDecGetCurrentConfiguration(hDecoder);
                    byte b = pcfg->defObjectType;

                    return(result);
                }
            }
            catch (Exception ex)
            {
                logger.LogCritical(ex, null, null);
                throw;
            }
        }