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.