コード例 #1
0
        /// <summary>
        /// Create an instance of AudioFileOut.
        /// </summary>
        internal AudioFileOut(Stream stream, SpeechAudioFormatInfo formatInfo, bool headerInfo, IAsyncDispatch asyncDispatch)
        {
            _asyncDispatch       = asyncDispatch;
            _stream              = stream;
            _startStreamPosition = _stream.Position;
            _hasHeader           = headerInfo;

            _wfxOut = new WAVEFORMATEX();
            // if we have a formatInfo object, format conversion may be necessary
            if (formatInfo != null)
            {
                // Build the Wave format from the formatInfo
                _wfxOut.wFormatTag     = (short)formatInfo.EncodingFormat;
                _wfxOut.wBitsPerSample = (short)formatInfo.BitsPerSample;
                _wfxOut.nSamplesPerSec = formatInfo.SamplesPerSecond;
                _wfxOut.nChannels      = (short)formatInfo.ChannelCount;
            }
            else
            {
                // Set the default values
                _wfxOut = WAVEFORMATEX.Default;
            }
            _wfxOut.nBlockAlign     = (short)(_wfxOut.nChannels * _wfxOut.wBitsPerSample / 8);
            _wfxOut.nAvgBytesPerSec = _wfxOut.wBitsPerSample * _wfxOut.nSamplesPerSec * _wfxOut.nChannels / 8;
        }
コード例 #2
0
 internal EventNotify(ISpEventSource sapiEventSource, IAsyncDispatch dispatcher, bool additionalSapiFeatures)
 {
     _sapiEventSourceReference = new WeakReference(sapiEventSource);
     _dispatcher             = dispatcher;
     _additionalSapiFeatures = additionalSapiFeatures;
     _notifySink             = new SpNotifySink(this);
     sapiEventSource.SetNotifySink(_notifySink);
 }
コード例 #3
0
        internal EventNotify(ISpEventSource sapiEventSource, IAsyncDispatch dispatcher, bool additionalSapiFeatures)
        {
            // Remember event source
            _sapiEventSourceReference = new WeakReference(sapiEventSource);

            _dispatcher             = dispatcher;
            _additionalSapiFeatures = additionalSapiFeatures;

            // Start listening to events from sapiEventSource.
            _notifySink = new SpNotifySink(this);
            sapiEventSource.SetNotifySink(_notifySink);
        }
コード例 #4
0
 internal AudioFileOut(Stream stream, SpeechAudioFormatInfo formatInfo, bool headerInfo, IAsyncDispatch asyncDispatch)
 {
     _asyncDispatch       = asyncDispatch;
     _stream              = stream;
     _startStreamPosition = _stream.Position;
     _hasHeader           = headerInfo;
     _wfxOut              = default(WAVEFORMATEX);
     if (formatInfo != null)
     {
         _wfxOut.wFormatTag     = (short)formatInfo.EncodingFormat;
         _wfxOut.wBitsPerSample = (short)formatInfo.BitsPerSample;
         _wfxOut.nSamplesPerSec = formatInfo.SamplesPerSecond;
         _wfxOut.nChannels      = (short)formatInfo.ChannelCount;
     }
     else
     {
         _wfxOut = WAVEFORMATEX.Default;
     }
     _wfxOut.nBlockAlign     = (short)(_wfxOut.nChannels * _wfxOut.wBitsPerSample / 8);
     _wfxOut.nAvgBytesPerSec = _wfxOut.wBitsPerSample * _wfxOut.nSamplesPerSec * _wfxOut.nChannels / 8;
 }
コード例 #5
0
ファイル: AudioDeviceOut.cs プロジェクト: z77ma/runtime
 /// <summary>
 /// Create an instance of AudioDeviceOut.
 /// </summary>
 internal AudioDeviceOut(int curDevice, IAsyncDispatch asyncDispatch)
 {
     _delegate      = new Interop.WinMM.WaveOutProc(CallBackProc);
     _asyncDispatch = asyncDispatch;
     _curDevice     = curDevice;
 }
コード例 #6
0
ファイル: AudioDeviceOut.cs プロジェクト: wilfriedb/runtime
 /// <summary>
 /// Create an instance of AudioDeviceOut.
 /// </summary>
 internal AudioDeviceOut(int curDevice, IAsyncDispatch asyncDispatch)
 {
     _delegate      = new SafeNativeMethods.WaveOutProc(CallBackProc);
     _asyncDispatch = asyncDispatch;
     _curDevice     = curDevice;
 }
コード例 #7
0
 internal AudioDeviceOut(int curDevice, IAsyncDispatch asyncDispatch)
 {
     _delegate      = CallBackProc;
     _asyncDispatch = asyncDispatch;
     _curDevice     = curDevice;
 }