Page 1 of 2

Problem with function Tone FWH 8.04

Posted: Tue May 20, 2008 11:27 am
by mauri.menabue

Code: Select all

function Main()

   alert("Test sounds")
   Tone(  100, 1 )
   Tone(  200, 1 )
   Tone(  300, 1 )
   Tone(  400, 1 )
   Tone(  500, 1 )
   Tone(  600, 1 )
   Tone(  700, 1 )
   Tone(  800, 1 )
   Tone(  900, 1 )
   Tone( 1000, 1 )

return nil

OS. Xp Professional
xHarbour CVS
BCC 55

Re: Problem with function Tone FWH 8.04

Posted: Tue May 20, 2008 11:49 am
by toninhofwi
[quote="mauri.menabue"]

Code: Select all

function Main()

   alert("Test sounds")
   Tone(  100, 1 )
   Tone(  200, 1 )
   Tone(  300, 1 )
   Tone(  400, 1 )
   Tone(  500, 1 )
   Tone(  600, 1 )
   Tone(  700, 1 )
   Tone(  800, 1 )
   Tone(  900, 1 )
   Tone( 1000, 1 )

return nil

Try to add:

request HB_GT_GUI_DEFAULT

in the main function.

Regards,

Toninho.

Posted: Tue May 20, 2008 1:43 pm
by Roger Seiler
What actually is the problem? Are the sounds not being generated?

Posted: Tue May 20, 2008 2:20 pm
by Antonio Linares
Roger,

Tone() is only supported in some GT modules for Harbour/xHarbour

Posted: Tue May 20, 2008 7:23 pm
by mauri.menabue
Roger

This is the problem, but with

request HB_GT_GUI_DEFAULT

is now OK :wink:

thank Toninho

Posted: Wed May 21, 2008 8:59 pm
by Roger Seiler
Okay. But when I link in gtgui.lib and put REQUEST HB_GT_GUI_DEFAULT at the top of my main prg, I get a link error with xHb (commercial Nov '07):

unresolved external symbol: _HB_FUN_HB_GT_GUI_DEFAULT

Any suggestions?

- Roger

Posted: Wed May 21, 2008 9:17 pm
by Antonio Linares
Roger,

Try this code from your PRG (same parameters as Tone()):

Code: Select all

#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>

HB_FUNC( BEEP )
{
   Beep( hb_parnl( 1 ), hb_parnl( 2 ) * 1000 );
}

#pragma ENDDUMP

Posted: Wed May 21, 2008 9:37 pm
by Roger Seiler
Antonio,

I tried it and nothing happened (no sound).

- Roger :(

Posted: Wed May 21, 2008 9:45 pm
by Roger Seiler
Antonio,

Whoops! I misunderstood how to use it. I figured it out, and now it works - I now get my beep.

Thanks!

- Roger

Posted: Wed May 21, 2008 9:59 pm
by Antonio Linares
Roger,

What Windows version are you using and how you made it work ?

Here it is not working (on Vista) :-(

Posted: Wed May 21, 2008 10:00 pm
by Roger Seiler
Antonio,

I don't know if anybody noticed, but though you are a quarter of the way around the world from where I'm sitting, you answered my question with a spot-on solution in just 18 minutes! And I had my problem fixed in my app in less than an hour.

I think that is PHENOMENAL customer service!

Thank you very much indeed!

- Roger :D

Posted: Wed May 21, 2008 10:03 pm
by Antonio Linares
I guess that its because I don't have an internal speaker

Do you hear it on your external speakers ?

Posted: Wed May 21, 2008 10:05 pm
by Antonio Linares
Roger,

Thanks for your kind words :-)

Posted: Thu May 22, 2008 1:54 am
by Roger Seiler
Antonio,

Regarding type of speakers I'm using: internal.

Version of Windows where I tested: XP Professional.

It sounded normal in this configuration.

I'll hook up some external speakers in the morning and see if it works there, and will also test on my Vista computer.

Then I'll report the results.

- Roger

Posted: Thu May 22, 2008 2:11 am
by Roger Seiler
Antonio,

It also works fine here on Vista Home Premium, internal speakers.

- Roger