Bass Recording Device.
Inheritance: IDisposable
Esempio n. 1
0
        /// <summary>
        /// Creates a new instance of <see cref="Record"/>.
        /// </summary>
        public Record(RecordDevice Device, int Frequency, int Channels, Resolution Resolution = Resolution.Short)
        {
            Bass.Init(0);
            Device.Init();
            
            Bass.CurrentRecordingDevice = Device.Index;
            
            _handle = Bass.RecordStart(Frequency, Channels, BassFlags.RecordPause | Resolution.ToBassFlag(), Processing);

            AudioFormat = WaveFormat.FromChannel(_handle);
        }
Esempio n. 2
0
        /// <summary>
        /// Get Device by Index.
        /// </summary>
        public static RecordDevice GetByIndex(int Device)
        {
            if (Singleton.ContainsKey(Device))
                return Singleton[Device];

            DeviceInfo info;
            if (!Bass.RecordGetDeviceInfo(Device, out info))
                throw new ArgumentException("Invalid RecordingDevice Index");

            var dev = new RecordDevice(Device);
            Singleton.Add(Device, dev);

            return dev;
        }
Esempio n. 3
0
 /// <summary>
 /// Creates a new instance of <see cref="Record"/> with the Default Format.
 /// </summary>
 /// <param name="Device">The <see cref="RecordDevice"/> to use.</param>
 public Record(RecordDevice Device) : this(Device, 44100, 2) { }
Esempio n. 4
0
 void Ensure() => Current = this;