waveaudio and MSSQL

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

waveaudio and MSSQL

Postby Koltron » March 21st, 2007, 7:55 pm

How would I record and playback waves files using waveaudio and storing them in a MSSQL table?

Thanks
Koltron
Member
Member
 
Posts: 4
Joined: March 21st, 2007, 7:51 pm

Postby Kambiz » March 21st, 2007, 8:44 pm

1. Look at TWaveStreamAdapter class in the latest release of the Wave Audio package.
2. Look at TBlobStream in Delphi's help.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Postby Koltron » March 21st, 2007, 8:47 pm

i'm new in delphi. Would there by chance be a example out of how the use it.
Koltron
Member
Member
 
Posts: 4
Joined: March 21st, 2007, 7:51 pm

Postby Johnny_Bit » March 22nd, 2007, 7:21 pm

If my memory does not deceive me, I'm pretty sure, that you ought to find what you are looking for on your hard drive IF you installed full Delphi.
Johnny_Bit
VIP Member
VIP Member
 
Posts: 455
Joined: June 15th, 2003, 9:56 am

Postby Koltron » March 22nd, 2007, 7:23 pm

I can handle the blob part, but using the Adapter is my concern
Koltron
Member
Member
 
Posts: 4
Joined: March 21st, 2007, 7:51 pm

Postby Kambiz » March 24th, 2007, 12:18 am

Suppose you have a blob field and it is associated with a TBlobField object named MyBlobField.

Playing the blob:

Code: Select all
var
  BlobStream: TBlobStream;

procedure TForm1.FormCreate(Sender: TObject);
begin
  BlobStream := TBlobStream.Create(MyBlobField, bmRead);
  StockAudioPlayer1.PlayStream(BlobStream);
end;

procedure TForm1.StockAudioPlayer1Deactivate(Sender: TObject);
begin
  BlobStream.Free;
end;


Recording in to the blob:

Code: Select all
var
  BlobStream: TBlobStream;

procedure TForm1.FormCreate(Sender: TObject);
begin
  BlobStream := TBlobStream.Create(MyBlobField, bmWrite);
  StockAudioRecorder1.RecordToStream(BlobStream);
end;

procedure TForm1.StockAudioRecorder1Deactivate(Sender: TObject);
begin
  BlobStream.Free;
end;


Accessing wave audio details stored in the blob:

Code: Select all
var
  Wave: TWaveStreamAdapter;
begin
  Wave := TWaveStreamAdapter.Create(TBlobStream.Create(MyBlobField, bmRead), soOwned);
  try
    ShowMessage(Wave.AudioFormat);
  finally
    Wave.Free;
  end;
end;
Last edited by Kambiz on August 5th, 2007, 7:58 am, edited 1 time in total.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Postby Koltron » March 26th, 2007, 4:30 pm

thank you so much

//EDIT:

can multiple wav files be stored in the same blob field?

//mod edit: EDIT!
Koltron
Member
Member
 
Posts: 4
Joined: March 21st, 2007, 7:51 pm

Postby Kambiz » March 27th, 2007, 12:11 am

Although it is not a good idea, but the answer is yes. Remember that you have to save somewhere starting position and length of each wave.
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: Bing [Bot] and 1 guest