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