Exemple #1
0
        private void Init()
        {
            g_AudioFormats = new PCM_Audio_Format_Params[12];

            g_AudioFormats[0] = new PCM_Audio_Format_Params(48000, 16, 2);
            g_AudioFormats[1] = new PCM_Audio_Format_Params(48000, 8, 2);
            g_AudioFormats[2] = new PCM_Audio_Format_Params(44100, 16, 2);
            g_AudioFormats[3] = new PCM_Audio_Format_Params(44100, 8, 2);
            g_AudioFormats[4] = new PCM_Audio_Format_Params(22050, 16, 2);
            g_AudioFormats[5] = new PCM_Audio_Format_Params(22050, 8, 2);

            g_AudioFormats[6] = new PCM_Audio_Format_Params(48000, 16, 1);
            g_AudioFormats[7] = new PCM_Audio_Format_Params(48000, 8, 1);
            g_AudioFormats[8] = new PCM_Audio_Format_Params(44100, 16, 1);
            g_AudioFormats[9] = new PCM_Audio_Format_Params(44100, 8, 1);
            g_AudioFormats[10] = new PCM_Audio_Format_Params(22050, 16, 1);
            g_AudioFormats[11] = new PCM_Audio_Format_Params(22050, 8, 1);

            m_IsShutdown = false;
        }
Exemple #2
0
        void InitializePCMWaveFormat(out WaveFormatEx pWav, PCM_Audio_Format_Params param)
        {
            pWav = new WaveFormatEx();

            pWav.wFormatTag = 1;
            pWav.cbSize = 0;

            pWav.nChannels = param.nChannels;
            pWav.nSamplesPerSec = param.nSamplesPerSec;
            pWav.wBitsPerSample = param.wBitsPerSample;

            // Derived values
            pWav.nBlockAlign = (short)(pWav.nChannels * (pWav.wBitsPerSample / 8));
            pWav.nAvgBytesPerSec = pWav.nSamplesPerSec * pWav.nBlockAlign;
        }