How to do sound

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

How to do sound

Postby Luis Babboni » Feb 13, 2019 18:14

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: 1892
Joined: Sep 25, 2005 21:54

Re: How to do sound

Postby srvaldez » Feb 13, 2019 18:41

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

Re: How to do sound

Postby fxm » Feb 13, 2019 18:54

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: 300
Joined: Mar 15, 2015 12:41

Re: How to do sound

Postby Luis Babboni » Feb 14, 2019 1:02

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! :-)

Return to “Beginners”

Who is online

Users browsing this forum: Exabot [Bot] and 4 guests