Jump to content

Problem with Sound...


Recommended Posts

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
Link to comment
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

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

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...