コード例 #1
0
        /// <summary>
        /// Gets the position of the waveout stream from the WindowsAPI.
        /// </summary>
        /// <returns></returns>
        internal uint GetPosition()
        {
            lock (_waveOutLock)
            {
                var multimediaTime = new MultimediaTime();
                multimediaTime.wType = MultimediaTime.TIME_BYTES;

                MultimediaException.Try(WaveInterop.waveOutGetPosition(_hWaveOut,
                                                                       ref multimediaTime,
                                                                       Marshal.SizeOf(multimediaTime)),
                                        "waveOutGetPosition");

//				if (multimediaTime.wType != MultimediaTime.TIME_BYTES)
//					throw new Exception(string.Format("waveOutGetPosition: wType -> Expected {0}, Received {1}",
//													  MultimediaTime.TIME_BYTES, multimediaTime.wType));

                return(multimediaTime.cb);
            }
        }
コード例 #2
0
ファイル: WaveInterop.cs プロジェクト: kevL/FXE_Generator
 public static extern MultimediaResult waveOutGetPosition(IntPtr hWaveOut,
                                                          ref MultimediaTime mmTime,
                                                          int uSize);