TWaveAudio Play File

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

TWaveAudio Play File

Postby Marius0188 » July 10th, 2007, 5:09 pm

Dear Friends,

I am using Delphi 7, TStockAudioRecorder, TStockAudioPlayer and TWaveStorage.

My application records to a file and then stores the avi file in a database.
To replay a recording I save the the Blob field to file and use TStockAudioPlayer and TWaveStorage to play it.

The recording side is working 100%. I can also save a recording from DB to file and play it with the normal Windows Media Player, it's working but when trying the replay the recording with the TStockAudioPlayer there is no sound.

Here is the code for replaying:
Code: Select all

  trView.Active := True;
  qView.SQL.Text := 'SELECT RecordingTitle, Recording, FileExtention FROM tblRecordings WHERE RecordingID = ' + IntToStr(Integer(lsvRecordings.Selected.Data));
  qView.Open;
  FWavFile := FTempPath + qView.FieldByName('RecordingTitle').AsString +
    qView.FieldByName('FileExtention').AsString;

  (qView.FieldByName('Recording') AS TBlobField).SaveToFile(FWavFile);

  waStorage.Wave.LoadFromFile(FWavFile);
  trackProgress.Position := 0;
  trackProgress.Max := waStorage.Wave.Length;
  waStockPlayer.PlayStock(0);


Can Someone please advise me.

Thanks in advance.
Marius0188
Member
Member
 
Posts: 1
Joined: July 10th, 2007, 5:02 pm

Postby Kambiz » July 10th, 2007, 9:24 pm

  • Are you sure the recording process is correct?
  • Did you try to saved file (from the above code) using Windows Sound Recorder or Windows Media Player?
  • Are you sure the blob field doesn't see data as text to try to automatically convert its character encoding?

In other hand, you do not need to use TWaveStorage as an intermediate storage. Use TStockAudioRecorder and TStockAudioPlayer to record and play audio directly from a file.

Even you do not need to use a temporary file. You can use TStockAudioRecorder and TStockAudioPlayer to record and play audio directly from a stream. In your case, the stream is a TBlobStream.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Projects

Who is online

Users browsing this forum: No registered users and 1 guest

cron