Using TAudioRecorder

Please post bug reports, feature requests, or any question regarding the DELPHI AREA products here.

Using TAudioRecorder

Postby scissg » February 13th, 2004, 11:16 pm

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
scissg
Member
Member
 
Posts: 1
Joined: February 13th, 2004, 11:10 pm

Postby Kambiz » February 16th, 2004, 5:32 pm

Windows as default uses Microphone for recording line. You should use audio mixer to select the proper input line for your purpose.
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Postby zippo » June 15th, 2005, 2:50 pm

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?
zippo
Active Member
Active Member
 
Posts: 5
Joined: June 14th, 2005, 3:24 pm

Postby Kambiz » June 15th, 2005, 5:35 pm

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.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Postby zippo » June 17th, 2005, 7:42 am

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.. :)
zippo
Active Member
Active Member
 
Posts: 5
Joined: June 14th, 2005, 3:24 pm

Postby Kambiz » June 18th, 2005, 8:19 am

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.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Products

Who is online

Users browsing this forum: No registered users and 1 guest