//!!!!было. file stream менялся, пока отключено //protected override Sound _SoundCreate( VirtualFileStream stream, bool closeStreamAfterReading, SoundType soundType, SoundModes mode ) //{ // criticalSection.Enter(); // OpenALSound sound; // bool initialized; // if( (int)( mode & SoundModes.Stream ) == 0 ) // { // sound = new OpenALSampleSound( stream, soundType, null, mode, out initialized ); // if( closeStreamAfterReading ) // stream.Dispose(); // } // else // sound = new OpenALFileStreamSound( stream, closeStreamAfterReading, soundType, null, mode, out initialized ); // if( !initialized ) // { // sound.Dispose(); // sound = null; // } // criticalSection.Leave(); // return sound; //} protected override Sound _SoundCreateDataBuffer(SoundModes mode, int channels, int frequency, int bufferSize, DataReadDelegate dataReadCallback) { criticalSection.Enter(); Sound sound; if ((mode & SoundModes.Record) != 0) { OpenALCaptureSound captureSound = new OpenALCaptureSound(mode, channels, frequency, bufferSize); if (captureSound.alCaptureDevice == IntPtr.Zero) { criticalSection.Leave(); return(null); } sound = captureSound; } else { sound = new OpenALDataStreamSound(mode, channels, frequency, bufferSize, dataReadCallback); } criticalSection.Leave(); return(sound); }
protected override void _RecordStop() { criticalSection.Enter(); if (recordingSound != null) { Alc.alcCaptureStop(recordingSound.alCaptureDevice); recordingSound = null; } criticalSection.Leave(); }
protected override bool _RecordStart(Sound sound) { criticalSection.Enter(); OpenALCaptureSound captureSound = sound as OpenALCaptureSound; if (captureSound == null) { criticalSection.Leave(); Log.Warning("OpenALSoundSystem: Recording failed. Is sound a not for recording."); return(false); } Alc.alcCaptureStart(captureSound.alCaptureDevice); recordingSound = captureSound; criticalSection.Leave(); return(true); }
public override void RecordStop() { criticalSection.Enter(); if( recordingSound != null ) { Alc.alcCaptureStop( recordingSound.alCaptureDevice ); recordingSound = null; } criticalSection.Leave(); }
public override bool RecordStart( Sound sound ) { criticalSection.Enter(); OpenALCaptureSound captureSound = sound as OpenALCaptureSound; if( captureSound == null ) { criticalSection.Leave(); Log.Warning( "OpenALSoundSystem: Recording failed. Is sound a not for recording." ); return false; } Alc.alcCaptureStart( captureSound.alCaptureDevice ); recordingSound = captureSound; criticalSection.Leave(); return true; }
public override Sound SoundCreateDataBuffer( SoundMode mode, int channels, int frequency, int bufferSize, DataReadDelegate dataReadCallback ) { criticalSection.Enter(); Sound sound; if( ( mode & SoundMode.Record ) != 0 ) { OpenALCaptureSound captureSound = new OpenALCaptureSound( mode, channels, frequency, bufferSize ); if( captureSound.alCaptureDevice == IntPtr.Zero ) { criticalSection.Leave(); return null; } sound = captureSound; } else { sound = new OpenALDataStreamSound( mode, channels, frequency, bufferSize, dataReadCallback ); } criticalSection.Leave(); return sound; }