<< Click to display table of contents >> TRVAudioPlayer |
A sound playing and recording component.
Unit [VCL and LCL] MRVAudioPlayer;
Unit [FMX] fmxMRVAudioPlayer;
Syntax
TRVAudioPlayer = class (TCustomRVAudioPlayer)
TObject TPersistent TComponent |
This component must be linked to TRVMicrophone, TRVCamSound or TRVCamReceiver components to play sound.
Without TRVAudioPlayer, TRVMicrophone cannot play or record sound.
Without TRVAudioPlayer, TRVCamSound cannot play or record sound, and cannot synchronize video playback speed to audio playback speed.
Without TRVAudioPlayer, TRVCamReceiver can play sound even without TRVAudioPlayer, but only on the default audio output device, with default sound parameters, and without recording to a file.
To play sound with this component, assign it to TRVMicrophone.AudioOutput, TRVCamSound.AudioOutput, or TRVCamReceiver.AudioOutput properties.
See the topic on TCustomRVAudioPlayer for properties controlling sound playing.
The component can record sound to a file. FFmpeg library must be available to the application for this feature.
The component supports recording to mp3, ogg, wav, flac and other formats, see EncodeAudioCodec property.
Warning: Some audio formats may be patent-protected in some countries, and supporting these formats will require from you obtaining licenses from the patent owners.
Recording is started when you assign True to Recording property. Sound is recorded to OutputFileName.
Recording is stopped when you assign False to Recording property, or change any of Encode* properties. When it is stopped, OnStopRecording occurs.
Alternatively, you can use TRVCamRecorder component for sound recording.
Linux (Lazarus): RVMedia uses ALSA (Advanced Linux Sound Architecture) to play sound. If ALSA is not available, it falls back to OSS (Open Sound System). However, an OSS support has less functionality, so ALSA is highly recommended.