Question about TAudioRedirector(1.85)

Please discuss general Delphi programming topics here.

Question about TAudioRedirector(1.85)

Postby john123 » December 4th, 2007, 2:52 pm

Hi,
in "unit WaveRedirector"
I have a question,
Is this correct?
Code: Select all
function TAudioRedirector.GetActive: Boolean;
begin
  Result := AudioIn.Active or AudioIn.Active;
end;

Other question:
sometimes, while Async = True after terminate program i receive follow error: EWaveAudioInvalidOperation "Device is aleardy close"
i guess problem is in "InternalClose" or on "destroy"
thanks for answer.
best regard
john123
Active Member
Active Member
 
Posts: 15
Joined: November 7th, 2007, 10:43 am

Postby Kambiz » December 5th, 2007, 12:15 am

It is wrong! Please correct it:

Code: Select all
function TAudioRedirector.GetActive: Boolean;
begin
  Result := AudioIn.Active or AudioOut.Active;
end;


Thank you!
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2430
Joined: March 7th, 2003, 7:10 pm

Postby john123 » December 5th, 2007, 10:55 am

What about second question?
john123
Active Member
Active Member
 
Posts: 15
Joined: November 7th, 2007, 10:43 am

Postby Kambiz » December 5th, 2007, 10:07 pm

I have no idea. Sorry, I'm too busy nowadays. I'll look it later.

But in my tests I have never seen this problem. If you are using threaded mode, be sure your event handlers are thread safe. Also, before shutting down the application, on OnClose event of the form, close the active devices.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2430
Joined: March 7th, 2003, 7:10 pm

Postby john123 » December 24th, 2007, 1:26 pm

Hi, Mr Kambiz
Could you take a look at the second question again? (also my code is thread safe).
thanks.
john123
Active Member
Active Member
 
Posts: 15
Joined: November 7th, 2007, 10:43 am

Postby Kambiz » December 24th, 2007, 3:07 pm

Without having the code I cannot help, sorry.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2430
Joined: March 7th, 2003, 7:10 pm


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 3 guests

cron