<< Click to display table of contents >> TCustomRVMicrophone |
TCustomRVMicrophone reads sound from a microphone (or other audio capture device) or an uncompressed WAV file.
Unit [VCL and LCL] MRVCustomMic;
Unit [FMX] fmxMRVCustomMic;
Syntax
TCustomRVMicrophone = class(TRVAudioSource)
TObject TPersistent TComponent |
Use
Objects of this class are not used directly. TRVMicrophone components are used instead.
Choosing a microphone (or other audio input device)
By default, the component reads sound from the default audio input device. You can choose another device.
A list of available devices is returned in AudioInputDeviceList array property, the count of devices is returned in AudioInputDeviceCount property.
You can choose the device by assigning to AudioInputDeviceIndex property (you can assign an index in AudioInputDeviceList, or -1 to choose the default device).
Sound from microphone
If Active=True, the component reads sound from a microphone.
The following properties allow changing the system properties of the microphone (affect all applications): Volume.
The following properties allow changing the sound read from a microphone before playing/sending it: VolumeMultiplier, NoiseReduction (and related properties), Pitch.
Mute turns off reading from the microphone.
The following properties allow to cut off non-informative sound: SoundMinLevel, SoundIgnoreInterval. The chart below shows how they work. The yellow curve shows an absolute value of a sound amplitude changing over time. The component ignores sound if: (1) it lies below SoundMinLevel, (2) it lies inside the interval defined by SoundIgnoreInterval.
Sound quality is specified in BitsPerSample and SamplesPerSec properties
Sound from WAV-files
To read sound from a file, assign SourceType=rvsstWAV, assign file name to WAVFileName, assign Active=True.
Only uncompressed WAV files are supported.
To apply modification properties to sound read from a file, assign WAVUseOptions=True.
While processing a file, OnOpenWavFile, OnReadWavFile, OnCloseWavFile events occur.