public WAVEFORMATEX(WAVEFormatTag format, short channels, int samplesPerSec, short bitsPerSample, short exSize) { this.wFormatTag = format; this.nChannels = channels; this.nSamplesPerSec = samplesPerSec; this.wBitsPerSample = bitsPerSample; this.nBlockAlign = Convert.ToInt16(this.nChannels * (this.wBitsPerSample / 8)); this.nAvgBytesPerSec = this.nSamplesPerSec * (int)this.nBlockAlign; this.cbSize = exSize; }
public unsafe static ACMFORMAT BASS_Encode_GetACMFormatSuggest(int handle, BASSACMFormat flags, WAVEFormatTag format) { ACMFORMAT result = null; int num = BassEnc.BASS_Encode_GetACMFormatUnicode(0, IntPtr.Zero, 0, null, BASSACMFormat.BASS_ACM_NONE); fixed(byte *ptr = new byte[num]) { if (BassEnc.BASS_Encode_GetACMFormat(handle, (IntPtr)((void *)ptr), num, null, (BASSACMFormat)Utils.MakeLong((int)flags, (int)format)) > 0) { result = new ACMFORMAT((IntPtr)((void *)ptr)); } } return(result); }