record/play to/from TStream with StockAudioRecorder/Player

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

record/play to/from TStream with StockAudioRecorder/Player

Postby Farderlorn » June 16th, 2006, 2:38 pm

Hello,

i try to record audio to TMemoryStream with StockAudioRecorder,
and play the stream after 1 second with StockAudioPlayer.
(The stream is still recording).

Has anyone a sample for me?

MikrofonStream := TMemoryStream .Create;
StockAudioRecorder1.RecordToStream(MikrofonStream);
MikrofonStream.Position := 0;

//Pause
...

//This causes an error
StockAudioPlayer1.PlayStream(MikrofonStream);

Error:
EWaveAudioSysError
'Ungültiger Parameter wurde an eine Systemfunktion übergeben.'.

Thanks, Farderlorn
Farderlorn
Member
Member
 
Posts: 2
Joined: June 16th, 2006, 2:21 pm

Postby Kambiz » June 19th, 2006, 8:33 pm

TStream has only one stream position pointer, and you need two for your purpose. One for reading and the other for writing.

You can implement an adaptor class for TStream to keep read and write positions.
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 0 guests

cron