public GtPlayedNotesAnalyserHelper(GtFactory pFactory, IAudioListener pAudioListener) { if (pAudioListener == null) { throw new Exception("pAudioListener can't be null!"); } this.Factory = pFactory; this.AudioListener = pAudioListener; this.LastQueriedPlayedNotes = new List <MusicalNoteAndTimeStamp>(); this.SpectrumAnalyzer = this.Factory.Instantiate <ISpectrumAnalyzer>(); }
/// <inheritdoc/> public bool Equals(IAudioListener other) { if (other is AudioListener) { var o = (AudioListener)other; return(AudioDevice == o.AudioDevice && Gain == other.Gain && Position == other.Position && Velocity == other.Velocity && Up == other.Up && At == other.At); } return(false); }
public AudioDevice(string deviceName) { if (deviceName != null && !AvailableDevices.Contains(deviceName)) { throw new InvalidOperationException(string.Format("AudioDevice \"{0}\" does not exist.", deviceName)); } Context = new OpenTK.Audio.AudioContext(deviceName, 0, 15, true, true, AudioContext.MaxAuxiliarySends.UseDriverDefault); CheckAlcError(); deviceHandle = Alc.GetContextsDevice(Alc.GetCurrentContext()); CheckAlcError(); Efx = new EffectsExtension(); CheckAlcError(); int[] val = new int[4]; DeviceName = Context.CurrentDevice; VendorName = AL.Get(ALGetString.Vendor); Renderer = AL.Get(ALGetString.Renderer); DriverVersion = AL.Get(ALGetString.Version); int major, minor; Alc.GetInteger(deviceHandle, AlcGetInteger.MajorVersion, 1, val); major = val[0]; Alc.GetInteger(deviceHandle, AlcGetInteger.MinorVersion, 1, val); minor = val[0]; Version = new Version(major, minor); Alc.GetInteger(deviceHandle, AlcGetInteger.EfxMajorVersion, 1, val); major = val[0]; Alc.GetInteger(deviceHandle, AlcGetInteger.EfxMinorVersion, 1, val); minor = val[0]; EfxVersion = new Version(major, minor); Alc.GetInteger(deviceHandle, AlcGetInteger.EfxMaxAuxiliarySends, 1, val); MaxRoutes = val[0]; Extensions = new List <string>(AL.Get(ALGetString.Extensions).Split(' ')).AsReadOnly(); AL.DistanceModel(ALDistanceModel.ExponentDistance); CheckAudioCapabilities(LogLevel.Verbose); LogDiagnostics(LogLevel.Verbose); Factory = new AudioFactory(this); Listener = new AudioListener(this); Listener.Orientation(Vector3.UnitY, Vector3.UnitZ); updateTaskCancelation = new CancellationTokenSource(); updateTask = Task.Factory.StartNew(Update); }
public GtPlayedNotesAnalyser(GtFactory pFactory, IAudioListener pAudioListener) { this.fFactory = pFactory; this.AnalyserHelper = this.fFactory.Instantiate <IGtPlayedNotesAnalyserHelper>(pFactory, pAudioListener); }
void IDisposable.Dispose() { listener = null; NatCorderAudio.Destroy(this); }
public ALAudioSystem(IAudioBackend backend, IAudioListener listener, IAudioErrors errors) { _backend = backend; Listener = listener; _errors = errors; }
public MockGtPlayedNotesAnalyserHelperAlwaysIsNotPlaying(GtFactory pFactory, IAudioListener pAudioListener) { }
public GtPlayedNotesAnalyserHelperMock(GtFactory pFactory, IAudioListener pAudioListener) : base(pFactory, pAudioListener) { }