예제 #1
0
        /// <summary>
        /// 设置预处理器属性参数
        /// </summary>
        /// <param name="setPreprocess">预处理器属性</param>
        /// <param name="value">具体参数</param>
        /// <returns>0 成功,-1 未知请求</returns>
        public int Set(SetPreprocess setPreprocess, int value)
        {
            IntPtr intPtr = GCHandle.Alloc(value, GCHandleType.Pinned).AddrOfPinnedObject();
            int    result = SpeexPreprocessApi.Speex_preprocess_ctl(preprocessMemAddress, (int)setPreprocess, intPtr);

            return(result);
        }
예제 #2
0
        /// <summary>
        /// 获取预处理器参数值
        /// </summary>
        /// <param name="getPreprocess">预处理器属性</param>
        /// <returns>预处理器属性值</returns>
        public int Get(GetPreprocess getPreprocess)
        {
            int    value  = 0;
            IntPtr intPtr = GCHandle.Alloc(value, GCHandleType.Pinned).AddrOfPinnedObject();
            int    result = SpeexPreprocessApi.Speex_preprocess_ctl(preprocessMemAddress, (int)getPreprocess, intPtr);

            if (result == 0)
            {
                result = Marshal.ReadInt32(intPtr);
            }
            return(result);
        }