Пример #1
0
        /// <summary>
        /// Sets the callback function for the specified cExternalSink component instance.
        /// The function will get called whenever another openSMILE component writes data to
        /// the cExternalSink component.
        /// </summary>
        /// <param name="componentName">Instance name of the cExternalSink component for which to set the callback.</param>
        /// <exception cref="ObjectDisposedException">
        /// Thrown if the object has already been disposed.
        /// </exception>
        /// <exception cref="InvalidOperationException">
        /// Thrown if openSMILE has not been initialized yet.
        /// </exception>
        /// <exception cref="OpenSmileException">
        /// Thrown for internal openSMILE errors.
        /// </exception>
        public void ExternalSinkSetCallback(string componentName, ExternalSinkCallback callback)
        {
            if (disposed)
            {
                throw new ObjectDisposedException(typeof(OpenSMILE).FullName);
            }
            if (smileObj == IntPtr.Zero)
            {
                throw new InvalidOperationException("openSMILE must be initialized first.");
            }

            CheckSmileResult(OpenSmileApi.Smile_extsink_set_data_callback(smileObj, componentName, callback, IntPtr.Zero));
        }
Пример #2
0
 public static extern OpenSmileResult Smile_extsink_set_data_callback(IntPtr smileobj, string componentName, ExternalSinkCallback callback, IntPtr param);