亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? wave.cs

?? 用C#實現(xiàn)的取得CellID和LAC的程序源代碼!
?? CS
字號:
using System;
using System.IO;
using System.Runtime.InteropServices;

namespace NiceTracker.Libraries
{
	/// <summary>
	/// Encapsulates Wave file properties used internally be WaveIn and WaveOut.
	/// </summary>
	public class Wave
	{
		// Can be used instead of a device id to open a device
		public const uint WAVE_MAPPER = unchecked((uint)(-1));

		// Flag specifying the use of a callback window for sound messages
		public const uint CALLBACK_NULL  = 0x0;
		public const uint CALLBACK_WINDOW  = 0x10000;

		// Error information...
		private const int WAVERR_BASE = 32;
		private const int MMSYSERR_BASE = 0;

		// Enum equivalent to MMSYSERR_*
		public enum MMSYSERR : int
		{
			NOERROR = 0,
			ERROR = (MMSYSERR_BASE + 1),
			BADDEVICEID = (MMSYSERR_BASE + 2),
			NOTENABLED = (MMSYSERR_BASE + 3),
			ALLOCATED = (MMSYSERR_BASE + 4),
			INVALHANDLE = (MMSYSERR_BASE + 5),
			NODRIVER = (MMSYSERR_BASE + 6),
			NOMEM = (MMSYSERR_BASE + 7),
			NOTSUPPORTED = (MMSYSERR_BASE + 8),
			BADERRNUM = (MMSYSERR_BASE + 9),
			INVALFLAG = (MMSYSERR_BASE + 10),
			INVALPARAM = (MMSYSERR_BASE + 11),
			HANDLEBUSY = (MMSYSERR_BASE + 12),
			INVALIDALIAS = (MMSYSERR_BASE + 13),
			BADDB = (MMSYSERR_BASE + 14),
			KEYNOTFOUND = (MMSYSERR_BASE + 15),
			READERROR = (MMSYSERR_BASE + 16),
			WRITEERROR = (MMSYSERR_BASE + 17),
			DELETEERROR = (MMSYSERR_BASE + 18),
			VALNOTFOUND = (MMSYSERR_BASE + 19),
			NODRIVERCB = (MMSYSERR_BASE + 20),
			LASTERROR = (MMSYSERR_BASE + 20)
		}

		// Enum equivalent to WAVERR_*
		private enum WAVERR : int
		{
			NONE = 0,
			BADFORMAT = WAVERR_BASE + 0,
			STILLPLAYING = WAVERR_BASE + 1,
			UNPREPARED = WAVERR_BASE + 2,
			SYNC = WAVERR_BASE + 3,
			LASTERROR = WAVERR_BASE + 3
		}

		/// <summary>
		/// Used by dwFormats in WAVEINCAPS and WAVEOUTCAPS
		/// Invalid format
		/// </summary>
		public const uint WAVE_INVALIDFORMAT = 0x00000000;
		/// <summary>
		/// Used by dwFormats in WAVEINCAPS and WAVEOUTCAPS
		/// 11.025 kHz, Mono,   8-bit
		/// </summary>
		public const uint WAVE_FORMAT_1M08 = 0x00000001;
		/// <summary>
		/// Used by dwFormats in WAVEINCAPS and WAVEOUTCAPS
		/// 11.025 kHz, Stereo, 8-bit
		/// </summary>
		public const uint WAVE_FORMAT_1S08 = 0x00000002;
		/// <summary>
		/// Used by dwFormats in WAVEINCAPS and WAVEOUTCAPS
		/// 11.025 kHz, Mono,   16-bit
		/// </summary>
		public const uint WAVE_FORMAT_1M16 = 0x00000004;
		/// <summary>
		/// Used by dwFormats in WAVEINCAPS and WAVEOUTCAPS
		/// 11.025 kHz, Stereo, 16-bit
		/// </summary>
		public const uint WAVE_FORMAT_1S16 = 0x00000008;
		/// <summary>
		/// Used by dwFormats in WAVEINCAPS and WAVEOUTCAPS
		/// 22.05  kHz, Mono,   8-bit
		/// </summary>
		public const uint WAVE_FORMAT_2M08 = 0x00000010;
		/// <summary>
		/// Used by dwFormats in WAVEINCAPS and WAVEOUTCAPS
		/// 22.05  kHz, Stereo, 8-bit
		/// </summary>
		public const uint WAVE_FORMAT_2S08 = 0x00000020;
		/// <summary>
		/// Used by dwFormats in WAVEINCAPS and WAVEOUTCAPS
		/// 22.05  kHz, Mono,   16-bit
		/// </summary>
		public const uint WAVE_FORMAT_2M16 = 0x00000040;
		/// <summary>
		/// Used by dwFormats in WAVEINCAPS and WAVEOUTCAPS
		/// 22.05  kHz, Stereo, 16-bit
		/// </summary>
		public const uint WAVE_FORMAT_2S16 = 0x00000080;
		/// <summary>
		/// Used by dwFormats in WAVEINCAPS and WAVEOUTCAPS
		/// 44.1   kHz, Mono,   8-bit
		/// </summary>
		public const uint WAVE_FORMAT_4M08 = 0x00000100;
		/// <summary>
		/// Used by dwFormats in WAVEINCAPS and WAVEOUTCAPS
		/// 44.1   kHz, Stereo, 8-bit
		/// </summary>
		public const uint WAVE_FORMAT_4S08 = 0x00000200;
		/// <summary>
		/// Used by dwFormats in WAVEINCAPS and WAVEOUTCAPS
		/// 44.1   kHz, Mono,   16-bit
		/// </summary>
		public const uint WAVE_FORMAT_4M16 = 0x00000400;
		/// <summary>
		/// Used by dwFormats in WAVEINCAPS and WAVEOUTCAPS
		/// 44.1   kHz, Stereo, 16-bit
		/// </summary>
		public const uint WAVE_FORMAT_4S16 = 0x00000800;

		/// <summary>
		/// WAVEFORMATEX defines the format of waveform-audio data. Only format
		/// information common to all waveform-audio data formats is included in
		/// this structure. For formats requiring additional information, this
		/// structure is included as the first member in another structure, along
		/// with the additional information.
		/// </summary>
		public class WAVEFORMATEX
		{
			// Accessors specifying data positions in a .wave file
			// RIFF header up to 20 bytes in .wav file
			protected const int WF_OFFSET_FORMATTAG = 20;
			protected const int WF_OFFSET_CHANNELS = 22;
			protected const int WF_OFFSET_SAMPLESPERSEC = 24;
			protected const int WF_OFFSET_AVGBYTESPERSEC = 28;
			protected const int WF_OFFSET_BLOCKALIGN = 32;
			protected const int WF_OFFSET_BITSPERSAMPLE = 34;
			// Offset 2 for wBitsPerSample
			// + 4 for the subchunk id "data"
			// + 4 for the subchunk length
			public const int WF_OFFSET_DATA = 44;

			/// <summary>
			/// Waveform-audio format type. Format tags are registered with Microsoft
			/// Corporation for many compression algorithms. A complete list of
			/// format tags is located in the Mmsystem.h header file. 
			/// </summary>
			public ushort wFormatTag = 0;
			/// <summary>
			/// Number of channels in the waveform-audio data. Monaural data uses one
			/// channel and stereo data uses two channels.
			/// </summary>
			public ushort nChannels = 0;
			/// <summary>
			/// Sample rate, in samples per second (hertz), that each channel should
			/// be played or recorded. If wFormatTag is WAVE_FORMAT_PCM, then common
			/// values for nSamplesPerSec are 8.0 kHz, 11.025 kHz, 22.05 kHz, and
			/// 44.1 kHz. For non-PCM formats, this member must be computed according
			/// to the manufacturer's specification of the format tag.
			/// </summary>
			public uint nSamplesPerSec = 0;
			/// <summary>
			/// Required average data-transfer rate, in bytes per second, for the format
			/// tag. If wFormatTag is WAVE_FORMAT_PCM, nAvgBytesPerSec should be equal to
			/// the product of nSamplesPerSec and nBlockAlign. For non-PCM formats, this
			/// member must be computed according to the manufacturer's specification of
			/// the format tag. 
			/// Playback and record software can estimate buffer sizes by using the
			/// nAvgBytesPerSec member. 
			/// </summary>
			public uint nAvgBytesPerSec = 0;
			/// <summary>
			/// Block alignment, in bytes. The block alignment is the minimum atomic unit
			/// of data for the wFormatTag format type. If wFormatTag is WAVE_FORMAT_PCM,
			/// nBlockAlign should be equal to the product of nChannels and wBitsPerSample
			/// divided by 8 (bits per byte). For non-PCM formats, this member must be
			/// computed according to the manufacturer's specification of the format tag. 
			/// Playback and record software must process a multiple of nBlockAlign bytes
			/// of data at a time. Data written and read from a device must always start
			/// at the beginning of a block. For example, it is illegal to start playback
			/// of PCM data in the middle of a sample (that is, on a non-block-aligned
			/// boundary). 
			/// </summary>
			public ushort nBlockAlign = 0;
			/// <summary>
			/// Bits per sample for the wFormatTag format type. If wFormatTag is
			/// WAVE_FORMAT_PCM, then wBitsPerSample should be equal to 8 or 16. For
			/// non-PCM formats, this member must be set according to the manufacturer's
			/// specification of the format tag. Some compression schemes cannot define
			/// a value for wBitsPerSample, so this member can be zero.
			/// </summary>
			public ushort wBitsPerSample = 0;

			/// <summary>
			/// Seeks the provided Stream to the position at which this structure starts.
			/// Namely, the wFormatTag member.
			/// </summary>
			/// <param name="fs"></param>
			public void SeekTo(Stream fs)
			{
				fs.Seek(WF_OFFSET_FORMATTAG, SeekOrigin.Begin);
			}

			/// <summary>
			/// Seeks the provided Stream to the position immediately after this
			/// structure.
			/// </summary>
			/// <param name="fs"></param>
			public void Skip(Stream fs)
			{
				fs.Seek(WF_OFFSET_DATA, SeekOrigin.Begin);
			}

			/// <summary>
			/// Read in a WAVEFORMATEX from the given BinaryReader.
			/// </summary>
			/// <param name="rdr">BinaryReader accessing a WAVEFORMATEX.</param>
			/// <returns>The size of the data following the structure</returns>
			public void Read(BinaryReader rdr)
			{
				wFormatTag		= rdr.ReadUInt16();
				nChannels		= rdr.ReadUInt16();
				nSamplesPerSec	= rdr.ReadUInt32();
				nAvgBytesPerSec	= rdr.ReadUInt32();
				nBlockAlign		= rdr.ReadUInt16();
				wBitsPerSample	= rdr.ReadUInt16();

				// Unused subchunk Id and size
				uint dataId		= rdr.ReadUInt32();
				uint dataLength	= rdr.ReadUInt32();
			}

			/// <summary>
			/// Write out a WAVEFORMATEX to the given BinaryWriter.
			/// </summary>
			/// <param name="wrtr">BinaryWriter to receive the WAVEFORMATEX
			/// information</param>
			public void Write(BinaryWriter wrtr)
			{
				wrtr.Write(wFormatTag);
				wrtr.Write(nChannels);
				wrtr.Write(nSamplesPerSec);
				wrtr.Write(nAvgBytesPerSec);
				wrtr.Write(nBlockAlign);
				wrtr.Write(wBitsPerSample);
			}
		}

		/// <summary>
		/// This structure defines the header used to identify a waveform-audio buffer.
		///		typedef struct 
		///		{
		///			LPSTR lpData;
		///			DWORD dwBufferLength;
		///			DWORD dwBytesRecorded;
		///			DWORD dwUser;
		///			DWORD dwFlags;
		///			DWORD dwLoops;
		///			struct wavehdr_tag *lpNext;
		///				DWORD reserved;}
		///			WAVEHDR;
		/// </summary>
		public class WAVEHDR : IDisposable
		{
			/// <summary>
			/// Used by dwFlags in WAVEHDR
			/// Set by the device driver to indicate that it is finished with the buffer
			/// and is returning it to the application.
			/// </summary>
			public const int WHDR_DONE = 0x00000001;
			/// <summary>
			/// Used by dwFlags in WAVEHDR
			/// Set by Windows to indicate that the buffer has been prepared with the
			/// waveInPrepareHeader or waveOutPrepareHeader function.
			/// </summary>
			public const int WHDR_PREPARED = 0x00000002;
			/// <summary>
			/// Used by dwFlags in WAVEHDR
			/// This buffer is the first buffer in a loop. This flag is used only with
			/// output buffers.
			/// </summary>
			public const int WHDR_BEGINLOOP = 0x00000004;
			/// <summary>
			/// Used by dwFlags in WAVEHDR
			/// This buffer is the last buffer in a loop. This flag is used only with
			/// output buffers.
			/// </summary>
			public const int WHDR_ENDLOOP = 0x00000008;
			/// <summary>
			/// Used by dwFlags in WAVEHDR
			/// Set by Windows to indicate that the buffer is queued for playback.
			/// </summary>
			public const int WHDR_INQUEUE = 0x00000010;

			/// <summary>
			/// Set in WAVEFORMATEX.wFormatTag to specify PCM data.
			/// </summary>
			public const int WAVE_FORMAT_PCM = 1;

			/// <summary>
			/// Long pointer to the address of the waveform buffer. This buffer must
			/// be block-aligned according to the nBlockAlign member of the
			/// WAVEFORMATEX structure used to open the device.
			/// </summary>
			public IntPtr lpData = IntPtr.Zero;
			/// <summary>
			/// Specifies the length, in bytes, of the buffer.
			/// </summary>
			public uint dwBufferLength = 0;
			/// <summary>
			/// When the header is used in input, this member specifies how much data
			/// is in the buffer.
			/// </summary>
			public uint dwBytesRecorded = 0;
			/// <summary>
			/// Specifies user data.
			/// </summary>
			public uint dwUser = 0;
			/// <summary>
			/// Specifies information about the buffer.
			/// </summary>
			public uint dwFlags = 0;
			/// <summary>
			/// Specifies the number of times to play the loop. This member is used
			/// only with output buffers.
			/// </summary>
			public uint dwLoops = 0;
			/// <summary>
			/// Reserved.
			/// </summary>
			public IntPtr lpNext = IntPtr.Zero;
			/// <summary>
			/// Reserved.
			/// </summary>
			public uint reserved = 0;

			/// <summary>
			/// Read a data buffer from the supplied BinaryReader.  This method will
			/// allocate memory for the data buffer it is not already allocated.
			/// </summary>
			/// <param name="rdr">BinaryReader containing data</param>
			/// <param name="readLength">Size, in bytes, to be read</param>
			/// <returns>MMSYSERR.NOERROR if successful</returns>
			public MMSYSERR Read(BinaryReader rdr, uint readLength, int align)
			{
				uint bufferLength = readLength;

				if (bufferLength % align != 0)
					bufferLength += (uint)(align - (bufferLength % align));

				dwBufferLength = bufferLength;
				byte[] data = new byte[readLength];
				rdr.Read(data, 0, data.Length);

				if (lpData == IntPtr.Zero)
					lpData = Memory.LocalAlloc(Memory.LMEM_FIXED, (uint)bufferLength);

				if (lpData == IntPtr.Zero)
					return MMSYSERR.NOMEM;
				
				Marshal.Copy(data, 0, lpData, data.Length);

				return MMSYSERR.NOERROR;
			}

			/// <summary>
			/// Write the contents of the recorded buffer to the supplied
			/// BinaryWriter.
			/// </summary>
			/// <param name="wrtr">BinaryWriter used as write target</param>
			/// <returns>MMSYSERR.NOERROR if successful</returns>
			public Wave.MMSYSERR Write(BinaryWriter wrtr)
			{
				if (lpData == IntPtr.Zero)
					return Wave.MMSYSERR.NOMEM;

				byte[] data = new byte[dwBytesRecorded];
				Marshal.Copy(lpData, data, 0, data.Length);
				wrtr.Write(data);

				return Wave.MMSYSERR.NOERROR;
			}

			/// <summary>
			/// Initialize an instance of a WAVEHDR with the specified buffer
			/// size.
			/// </summary>
			/// <param name="bufferLength">Size, in bytes, of buffer</param>
			/// <param name="init">true=clear data to 0</param>
			/// <returns>MMSYSERR.NOERROR if successful</returns>
			public MMSYSERR Init(uint bufferLength, bool init)
			{
				if (lpData != IntPtr.Zero && dwBufferLength < bufferLength)
				{
					Memory.LocalFree(lpData);
					lpData = IntPtr.Zero;
				}

				if (lpData == IntPtr.Zero)
					lpData = Memory.LocalAlloc(Memory.LMEM_FIXED, bufferLength);

				dwBufferLength = bufferLength;

				if (lpData == IntPtr.Zero)
					return MMSYSERR.NOMEM;

				if (init)
				{
					for (int i = 0; i < bufferLength; i++)
					{
						Marshal.WriteByte(lpData, i, 0);
					}
				}

				return MMSYSERR.NOERROR;
			}

			/// <summary>
			/// Frees any memory allocated for the buffer.
			/// </summary>
			public void Dispose()
			{
				if (lpData != IntPtr.Zero)
					Memory.LocalFree(lpData);
			}
		}
	}
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品一区二区三区免费视频| 欧美日韩亚洲国产综合| 久久成人麻豆午夜电影| 亚洲成人午夜影院| 亚洲一区在线观看网站| 亚洲色图在线看| 国产精品素人一区二区| 久久久久久99久久久精品网站| 欧美r级在线观看| 精品久久久久久久久久久久包黑料| 欧美日韩在线直播| 欧美精品视频www在线观看| 欧美日韩mp4| 51精品秘密在线观看| 91麻豆精品国产91久久久使用方法| 欧美美女激情18p| 91精品国产手机| 精品久久人人做人人爽| 精品国产乱码久久久久久蜜臀| 欧美zozo另类异族| 久久久精品影视| 中文字幕 久热精品 视频在线 | 欧美日韩久久一区二区| 在线中文字幕一区| 欧美男同性恋视频网站| 日韩欧美一级精品久久| 国产人妖乱国产精品人妖| 中文字幕欧美国产| 有坂深雪av一区二区精品| 亚洲国产日韩a在线播放| 婷婷久久综合九色国产成人 | 91丨porny丨蝌蚪视频| 色婷婷香蕉在线一区二区| 欧美亚男人的天堂| 欧美一区二区三区视频免费| 日韩欧美综合一区| 中文字幕av一区二区三区免费看| 一区二区三区毛片| 精品午夜久久福利影院| 波多野结衣在线一区| 在线看不卡av| 久久久美女艺术照精彩视频福利播放| 国产精品国产三级国产三级人妇| 亚洲大片精品永久免费| 狠狠色丁香久久婷婷综合丁香| 国产suv精品一区二区6| 欧美午夜精品电影| 久久婷婷一区二区三区| 亚洲日本中文字幕区| 亚洲电影一级片| 久久国产精品免费| 在线视频国产一区| 久久免费精品国产久精品久久久久| 亚洲人成在线观看一区二区| 日韩**一区毛片| 99热精品国产| 欧美精品一区二区三区在线| 国产精品久久久久久久午夜片| 亚洲最色的网站| 精品一区二区三区久久| 日本黄色一区二区| 久久久久青草大香线综合精品| 亚洲另类在线视频| 国产一区在线精品| 欧美在线免费观看视频| 久久久久久免费毛片精品| 亚洲乱码国产乱码精品精的特点| 激情综合色丁香一区二区| 色婷婷狠狠综合| 国产欧美精品日韩区二区麻豆天美| 日本欧美韩国一区三区| 91日韩精品一区| 国产色一区二区| 蜜桃久久久久久久| 欧美日韩国产精选| 亚洲美女偷拍久久| 国产91高潮流白浆在线麻豆| 欧美日韩激情一区二区| 亚洲视频一二三区| 国产ts人妖一区二区| 日韩欧美国产电影| 午夜视黄欧洲亚洲| 成人av影院在线| 欧美mv日韩mv亚洲| 天天影视网天天综合色在线播放| 成人a级免费电影| 国产欧美日本一区二区三区| 日本特黄久久久高潮| 91美女片黄在线| 中文字幕 久热精品 视频在线 | 欧美日韩国产中文| 亚洲精品国产一区二区三区四区在线| 国产中文一区二区三区| 日韩精品一区二| 美女视频黄a大片欧美| 777久久久精品| 亚洲成人综合在线| 色av一区二区| 一区二区三区四区av| 99久久国产综合色|国产精品| 久久久久9999亚洲精品| 精品伊人久久久久7777人| 日韩欧美综合在线| 美国毛片一区二区三区| 欧美日韩国产综合久久| 午夜伦欧美伦电影理论片| 欧美日韩国产在线观看| 亚洲电影一区二区三区| 欧美日韩在线三级| 亚洲va天堂va国产va久| 欧美精品18+| 视频一区视频二区中文| 日韩精品最新网址| 精品一区二区三区的国产在线播放| 欧美岛国在线观看| 国产又黄又大久久| 中文字幕国产一区| 91蜜桃在线免费视频| 一区二区三区四区不卡在线| 欧美影院一区二区| 日韩vs国产vs欧美| 亚洲精品在线网站| 国产91富婆露脸刺激对白| 中文字幕色av一区二区三区| 99精品桃花视频在线观看| 亚洲欧美日韩小说| 欧美久久婷婷综合色| 麻豆精品一区二区| 久久久精品国产免大香伊| 成人av免费在线播放| 中文字幕制服丝袜一区二区三区| 在线精品观看国产| 麻豆成人av在线| 国产精品久99| 制服.丝袜.亚洲.另类.中文| 精品一区在线看| 最新高清无码专区| 日韩一区二区三区四区| 成人高清视频免费观看| 一区二区三区日韩欧美| 91精品国产综合久久久久久漫画 | 精品久久久久久久久久久院品网 | 国产精品一区二区视频| 中文字幕视频一区| 在线观看91av| 国产成人综合自拍| 午夜精品久久久久久久99樱桃| 欧美精品一区二区久久久| 成人aa视频在线观看| 午夜精品久久久久| 国产婷婷一区二区| 欧美日韩三级在线| 国产成人在线电影| 五月综合激情婷婷六月色窝| 2024国产精品| 在线观看中文字幕不卡| 国产美女娇喘av呻吟久久| 亚洲精品v日韩精品| 精品国产乱码久久久久久久| 日本丶国产丶欧美色综合| 久色婷婷小香蕉久久| 亚洲蜜臀av乱码久久精品| 精品国产3级a| 欧美性感一类影片在线播放| 国产精品亚洲人在线观看| 一区二区理论电影在线观看| 欧美www视频| 欧美日韩精品一区二区天天拍小说| 国产成人综合网| 免费观看成人鲁鲁鲁鲁鲁视频| 国产精品成人一区二区艾草| 欧美一个色资源| 色婷婷精品久久二区二区蜜臀av | 精品日产卡一卡二卡麻豆| 日本久久一区二区| 成人精品鲁一区一区二区| 日本美女一区二区三区视频| 国产精品国模大尺度视频| 精品国产伦一区二区三区观看方式| 欧美综合天天夜夜久久| 福利视频网站一区二区三区| 全国精品久久少妇| 亚洲一区二区视频在线| 中文字幕一区二区三区精华液 | 国产乱码精品一区二区三区五月婷| 一区二区高清免费观看影视大全 | 日本一区二区电影| 欧美成人艳星乳罩| 欧美一区二区视频在线观看2022| 91久久线看在观草草青青| 成人晚上爱看视频| 国产真实乱对白精彩久久| 免费高清不卡av| 亚洲va在线va天堂| 亚洲在线观看免费视频| 亚洲欧美电影院| 亚洲精品成人在线| 亚洲自拍欧美精品| 一区二区三区中文字幕电影| 椎名由奈av一区二区三区|