Ejemplo n.º 1
0
        /// <summary>
        ///     语音转文字
        /// </summary>
        /// <param name="audioInfo">语音信息</param>
        /// <param name="jsonExtension">json_extension json扩展参数(备用,目前不需要)</param>
        /// <param name="cb">语音转文字回调</param>
        /// <param name="userData">APP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!</param>
        public static void GetAudioTextAsync(NIMAudioInfo audioInfo, string jsonExtension, NIMTools.GetAudioTextCb cb)
        {
            var json = audioInfo.Serialize();
            var ptr  = NimUtility.DelegateConverter.ConvertToIntPtr(cb);

            nim_tool_get_audio_text_async(json, jsonExtension, ConverteAudio2TextDelegate, ptr);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 语音转文字
        /// </summary>
        /// <param name="audioInfo">语音信息</param>
        /// <param name="cb">转换结果回调</param>
        /// <param name="userData">自定义数据,在回调函数中使用</param>
        public static void ConverteAudio2Text(NIMAudioInfo audioInfo, Audio2TextDelegate cb, object userData = null)
        {
            NimUtility.DelegateBaton <Audio2TextDelegate> baton = new NimUtility.DelegateBaton <Audio2TextDelegate>();
            baton.Action = cb;
            baton.Data   = userData;
            var json = audioInfo.Serialize();
            var ptr  = baton.ToIntPtr();

            nim_tool_get_audio_text_async(json, null, ConverteAudio2TextCallback2, ptr);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 语音转文字
        /// </summary>
        /// <param name="audioInfo">语音信息</param>
        /// <param name="jsonExtension">json_extension json扩展参数(备用,目前不需要)</param>
        /// <param name="cb">语音转文字回调</param>
        /// <param name="userData">APP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!</param>
        public static void GetAudioTextAsync(NIMAudioInfo audioInfo, string jsonExtension, NIMTools.GetAudioTextCb cb, IntPtr userData)
        {
            var json = audioInfo.Serialize();

            nim_tool_get_audio_text_async(json, jsonExtension, cb, userData);
        }