示例#1
0
        public override void Initialize(object config, string outPath)
        {
            m_config             = (fcAPI.fcFlacConfig)config;
            m_config.sampleRate  = AudioSettings.outputSampleRate;
            m_config.numChannels = fcAPI.fcGetNumAudioChannels();
            m_ctx = fcAPI.fcFlacCreateContext(ref m_config);

            var path = outPath + ".flac";

            m_ostream = fcAPI.fcCreateFileStream(path);
            fcAPI.fcFlacAddOutputStream(m_ctx, m_ostream);
        }
示例#2
0
        public override void Initialize(object config, string outPath)
        {
            if (!fcAPI.fcFlacIsSupported())
            {
                Debug.LogError("Flac encoder is not available on this platform.");
                return;
            }

            m_config             = (fcAPI.fcFlacConfig)config;
            m_config.sampleRate  = AudioSettings.outputSampleRate;
            m_config.numChannels = fcAPI.fcGetNumAudioChannels();
            m_ctx = fcAPI.fcFlacCreateContext(ref m_config);

            var path   = outPath + ".flac";
            var stream = fcAPI.fcCreateFileStream(path);

            fcAPI.fcFlacAddOutputStream(m_ctx, stream);
            stream.Release();
        }