Jump to content

Beep


trancexx
 Share

Recommended Posts

DirectSound offers plenty. Up until recently it was unavailable in AutoIt. AutoItObject obviously changed that.

Example that follows is using IDirectSound (IDirectSound8 precisely) and IDirectSoundBuffer interfaces to generate beep sound in your speakers.

Normally you would use Beep(), but on some systems that function is unavailable (XP x64 and some more). When you want to be sure beep occurs you have to have a backup plan. This is one possible backup.

Difference between the built-in beep is that on x64 systems simulation beep will be sine wave which is soft(er) and this script, for example, will play square wave which sounds very similar to original onboard beeper sound.

You will need AutoItObject.au3.

Script:

Beep.au3

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Here's another example with DirectSound. WAVE file(data) player. Something similar to what monoceres posted 100 years ago with flat waveOutWrite function (I saved that script with name WAVE_PlayStructure.au3).

Now with DirectSound. And with total control through it. You can play faster, slower, left, right, stop, play from,...

In the example I'm just playing with speed.

Zip includes script and wav file:

PlayWAVE.zip

Again AutoItObject.au3 is required.

Someone might ask: "Why would I play wav at all and why like that?"

Except the fact that you are actually playing raw binary data (variable, resource of your exe, dll, whatever), there isn't much sense.

In more than one occasion you would need to do just that.

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...