Page 1 of 1

Using TAudioRecorder

PostPosted: February 13th, 2004, 11:16 pm
by scissg
Hi,
I am trying to get TAudioRecorder to work. I have the following routines:

procedure TForm1.btnSaveWaveClick(Sender: TObject);
begin
if dlgSaveWave.Execute then
lblSaveWave.Caption := dlgSaveWave.FileName
else
lblSaveWave.Caption := '';
end;

procedure TForm1.btnRecordWaveClick(Sender: TObject);
begin
arRecordWave.DeviceID := 0;
arRecordWave.Active := True;
end;

procedure TForm1.btnStopRecordingClick(Sender: TObject);
begin
arRecordWave.Active := False;
arRecordWave.Wave.SaveToFile(lblSaveWave.Caption);
lblLastError.Caption := arRecordWave.LastErrorText;
end;


To test the code, I start a music file playing using Windows Media Player and then set the name of the file I want recorded into the lblSaveWave label. Then I invoke the 'start recording' sequence. After the song is over, I click the 'stop recording' button to save the stream to a file.

The stream successfully saves but it it all 'silence' -- no music. What am I doing wrong? :?: :?: THANKS for the help!!! :D

PostPosted: February 16th, 2004, 5:32 pm
by Kambiz
Windows as default uses Microphone for recording line. You should use audio mixer to select the proper input line for your purpose.

PostPosted: June 15th, 2005, 2:50 pm
by zippo
And how to select the proper input line?

I'm new to multimedia in windows, so maybe the question is silly, but I'll risk.. :)

One more question: How do I convert the LiveAudio demo to play a file instead of microphone? Can I still use LiveAudioRecorder component?

PostPosted: June 15th, 2005, 5:35 pm
by Kambiz
First question: please look at the following topic:
http://www.delphiarea.com/forum/viewtopic.php?t=212

Second Question: you have to supply wave format and wave data to TLiveAudioRecording by reading the wave file.

PostPosted: June 17th, 2005, 7:42 am
by zippo
I did this, but the problem is :oops: :oops: i don't know how to supply wave format to the component ... :oops:

So I studied the components, and have more questions :)

What's the main difference between TStockAudioRecorder and TAudioRecorder - in both cases you open a wave and play it, so why the stock?

The provided help file is very good, but I miss just one thing: Explanation on component usage.. :)

PostPosted: June 18th, 2005, 8:19 am
by Kambiz
TStockAudioPlayer can play a wave directry from any kind of stream, but TAudioPlayer can only play wave that is stored in its Wave property.

For your first question, you can use GetStreamWaveAudioInfo function that is defined in WaveUtils unit. This function is frequently used in the package, so you have many samples.