/// <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; }
internal EventNotify(ISpEventSource sapiEventSource, IAsyncDispatch dispatcher, bool additionalSapiFeatures) { _sapiEventSourceReference = new WeakReference(sapiEventSource); _dispatcher = dispatcher; _additionalSapiFeatures = additionalSapiFeatures; _notifySink = new SpNotifySink(this); sapiEventSource.SetNotifySink(_notifySink); }
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); }
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; }
/// <summary> /// Create an instance of AudioDeviceOut. /// </summary> internal AudioDeviceOut(int curDevice, IAsyncDispatch asyncDispatch) { _delegate = new Interop.WinMM.WaveOutProc(CallBackProc); _asyncDispatch = asyncDispatch; _curDevice = curDevice; }
/// <summary> /// Create an instance of AudioDeviceOut. /// </summary> internal AudioDeviceOut(int curDevice, IAsyncDispatch asyncDispatch) { _delegate = new SafeNativeMethods.WaveOutProc(CallBackProc); _asyncDispatch = asyncDispatch; _curDevice = curDevice; }
internal AudioDeviceOut(int curDevice, IAsyncDispatch asyncDispatch) { _delegate = CallBackProc; _asyncDispatch = asyncDispatch; _curDevice = curDevice; }