Sign in to follow this  
Followers 0
Enforcer

Problem with Sound...

4 posts in this topic

Got simple script:

;AdlibEnable("Play", 1500)

Global $Paused

HotKeySet("x", "playxxx")
HotKeySet("y", "play")

While 1
    Sleep(100)
WEnd

Func Play()
    SoundPlay("YYY.wav",0)
EndFunc

Func Playxxx()
    SoundPlay("XXX.wav",0)
EndFunc

And have 2 problems:

1) don't know how to make 2 or more sounds that will play at one time ?

2) how to create 2 or more loops that will play continuosly ?

Didn't find enything on Autoit HElp file and on Autoit forums 2 :P


[RU] Zone

Share this post


Link to post
Share on other sites



1. To play multiple sounds simultaneously use _SoundOpen() on both files and then play them with _SoundPlay(). These can be found under "Sound Management" in the helpfile.

2. You want what? Loop the sounds? Use loop _SoundStatus() and when it is "stopped" then play it again

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Enforcer,

Use the include file Sound.au3 to play sounds - it is much more flexible than SoundPlay. This works for me:

#include <Sound.au3>

$hMusic_handle1 = _SoundOpen("L:\Digital Music\Beck, Jeff\Performing This Week\04-Cause We're Ended As Lovers.mp3")
$hMusic_handle2 = _SoundOpen("L:\Digital Music\Umphrey's McGee\06-Mantis\04-Cemetery Walk.mp3")

SoundSetWaveVolume(100)

_SoundPlay($hMusic_handle1)
Sleep(5000) ; just so you can see it plays both!
_SoundPlay($hMusic_handle2)

While 1

    Sleep(100)

WEnd

M23

Edit: The Admiral is a much faster typist than I am!

Edited by Melba23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
:P Thx for answer. I think this will solve my problems

[RU] Zone

Share this post


Link to post
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
Sign in to follow this  
Followers 0