How to do sound

New to FreeBASIC? Post your questions here.
Post Reply
Luis Babboni
Posts: 375
Joined: Mar 15, 2015 12:41

How to do sound

Post by Luis Babboni »

I need to make just two sounds.
A low frequency one and a high frequency one.

There is no simpler way to do them than needing to use such things as FMOD, BASS.bi, etc?
What and where I need to add thats .bi?

I just need one sound if a variable is some number and the other sound if that variable is other number.

Any hint?

Thanks!
srvaldez
Posts: 3383
Joined: Sep 25, 2005 21:54

Re: How to do sound

Post by srvaldez »

you may be able to use PlaySound https://docs.microsoft.com/en-us/previo ... quirements
also have a look at this post, perhaps it will you some ideas viewtopic.php?p=220706#p220706
fxm
Moderator
Posts: 12159
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: How to do sound

Post by fxm »

Under Windows (except Win95):

Code: Select all

#include "windows.bi"
    'type WINBOOL as long
    'type DWORD as ulong
    'declare function Beep_ alias "Beep"(byval dwFreq as DWORD, byval dwDuration as DWORD) as WINBOOL

Beep_(1000, 1000)  ' (1000 Hz, 1000 ms)

Sleep
Luis Babboni
Posts: 375
Joined: Mar 15, 2015 12:41

Re: How to do sound

Post by Luis Babboni »

fxm wrote:Under Windows (except Win95):

Code: Select all

#include "windows.bi"
    'type WINBOOL as long
    'type DWORD as ulong
    'declare function Beep_ alias "Beep"(byval dwFreq as DWORD, byval dwDuration as DWORD) as WINBOOL

Beep_(1000, 1000)  ' (1000 Hz, 1000 ms)

Sleep
Perfect!!! I do not need more than this!

Thanks fxm! :-)
Post Reply