Beispiel #1
0
        public WaveOutputPort(int deviceID, WAVEFORMATEX wf)
        {
            fCallbackMethod = new WaveCallback(this.DefaultAudioCallback);

            DeviceHandle = null;
            DeviceID = deviceID;
            WaveFormat = wf;
            PCMFormat = PCMAudioFormat.CreateFromWaveFormat(wf);
            
            Open();
        }
Beispiel #2
0
        public WinMMAudioDevice(int deviceID, WAVEFORMATEX wf)
        {
            fCallbackMethod = new WaveCallback(this.DefaultAudioCallback);

            fDeviceHandle = IntPtr.Zero;
            fDeviceID = deviceID;
            fWaveFormat = wf;
            fPCMFormat = PCMAudioFormat.CreateFromWaveFormat(wf);

            //if (callbackProc != null)
            //    fCallbackProcedure = callbackProc;
            //else
            //    fCallbackProcedure = DefaultAudioCallback;
        }
Beispiel #3
0
        public static PCMAudioFormat CreateFromWaveFormat(WAVEFORMATEX wfx)
        {
            PCMAudioFormat af = new PCMAudioFormat(wfx.nChannels, wfx.wBitsPerSample, (int)wfx.nSamplesPerSec);

            return af;
        }