Exception in StockAudioPlayer.PlayStream

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

Exception in StockAudioPlayer.PlayStream

Postby ArturAs » April 7th, 2012, 7:19 pm

Where is my mistake? error in msvcrt.dll

This doesn't work: (Click Button1, then Button2)

Code: Select all
procedure TFmMain.Button1Click(Sender: TObject);
begin
  if stream = nil then
    stream := TMemoryStream.Create;
  StockAudioRecorder.RecordToStream( stream );
end;

procedure TFmMain.Button2Click(Sender: TObject);
begin
  if StockAudioPlayer.Active then
    StockAudioPlayer.Active := False
  else
    StockAudioRecorder.Active := False;
  StockAudioPlayer.PlayStream( Stream);
end;


This does: (Click Button1, then ButtonStop, then Button2)
===============================================
Code: Select all
procedure TFmMain.Button1Click(Sender: TObject);
begin
  if stream = nil then
    stream := TMemoryStream.Create;
  StockAudioRecorder.RecordToStream( stream )
end;

procedure TFmMain.Button2Click(Sender: TObject);
begin
  StockAudioPlayer.PlayStream( Stream);
end;

procedure TFmMain.ButtonStopClick(Sender: TObject);
begin
  if StockAudioPlayer.Active then
    StockAudioPlayer.Active := False
  else
    StockAudioRecorder.Active := False;
end;

Thanks
Artur
ArturAs
Member
Member
 
Posts: 1
Joined: April 7th, 2012, 7:02 pm

Re: Exception in StockAudioPlayer.PlayStream

Postby Kambiz » May 9th, 2012, 12:30 am

In asynchronous mode you should wait for the stop action (active := false) to be completed.
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 2 guests

cron