if Ext = '' then
raise EAuException.Create('Cannot determine the input file format');
if Ext = '.ogg' then
begin
Output := VorbisOut1;
VorbisOut1.Compression := SpinEdit1.Value/10;
end else
if Ext = '.flac' then
begin
Output := FLACOut1;
end else
if Ext = '.wav' then
Output := WaveOut1;
It becomes: if Ext = '' then
raise EAuException.Create('Cannot determine the input file format');
if Ext = '.ogg' then
begin
Output := VorbisOut1;
VorbisOut1.Compression := SpinEdit1.Value/10;
end else
if Ext = '.flac' then
begin
Output := FLACOut1;
end else
if Ext = '.wav' then
begin
Output := WaveOut1;
end else
if Ext = '.wma' then
begin
Output := WMAOut1;
end;
(* Property: DesiredBitrate
Set the desired bitrate for an output file (in the constant bitrate
lossy mode). The component will search for the best configuration
matching your parameters, so the actual bitrate may be less than this
value. *)
property DesiredBitrate : LongWord read FBitrate write FBitrate;
(* Property: Lossless
Use this property to switch between the lossless and lossy compression modes.
In the lossless mode the <DesiredBitrate> and <VBRQuality> values are ignored.
Lossless encoding is always VBR. *)
property Lossless : Boolean read FLossless write FLossless;
(* Property: VBR
Use this property to switch between constant bitrate and variable
bitrate lossy encoding modes. In VBR mode <DesiredBitrate> value is
ignored. The quality of the output sound is defined by the <VBRQuality>
property. If you encode data by directly selecting the codec and
format, note that the VBR setting affects <Formats> and <FormatsCount>
values for every codec. In the lossless mode the this property's value
is ignored. *)
property VBR : Boolean read FVBR write FVBR;
(* Property: VBRQuality
Use this property to set the output audio quality in VBR mode. The
valid values range from 1 to 99. This property only has an effect if
<VBR> is set to True and <Lossless> to False. *)
property VBRQuality : Byte read FVBRQuality write FVBRQuality;
(* Property: OnOutputError
This event is raised if an error occurs during the output. If the event handler is not set, the error is ignored.
The best way to handle this event is to call
> Sender.Stop(True);
from the handler.
When this event is called the ExceptionMessage property returns 'Windows Media output error' string. *)
http://lakeofsoft.com/vc/download.html
Also there are plenty of resources out there:
http://www.torry.net/pages.php?s=83
https://www.experts-exchange.com/questions/20694361/How-to-record-voice-directly-into-mp3-or-wma-format.html