Ejemplo n.º 1
0
        public AudioDevice(string deviceName, int numChannels, int samplingRate, int bitsPerSample)
        {
            if (cfgAudDec != IntPtr.Zero || audDec != IntPtr.Zero || aTxfDec != IntPtr.Zero)
            {
                return;
            }

            //allocate the data and config context
            cfgAudDec = MixCastAV.getAudioDecodeCfg(deviceName, numChannels, samplingRate, bitsPerSample,
                                                    AUDIO_NUMCHANNELS, AUDIO_SAMPLINGRATE, AUDIO_BITSPERSAMPLE);

            //setup the audio decode codec
            audDec = MixCastAV.getVideoDecodeContext(cfgAudDec);

            //setup the audio transformer for decode
            aTxfDec = MixCastAV.getVideoTransformContext(cfgAudDec);

            if (cfgAudDec != IntPtr.Zero && audDec != IntPtr.Zero && aTxfDec != IntPtr.Zero)
            {
                Debug.Log("Started Audio Device");
            }
            else
            {
                return;
            }

            //udatasize = LibAvStuff.getCfgOutputDataSize(cfgAudDec);

            //create the audio asynchronous interface
            //audAsyncDec = LibAvStuff.createAudioDecodeAsync(audDec, cfgAudDec, aTxfDec);
        }