Jump to content

sound in a loop


Recommended Posts

I made a script with a logon screen and some menu's. When the GUI opens there is a song playing for about 13 seconds ( I'm using Soundplay("sound.wav") ). I want the script to replay ( loop ) the sound while the rest of the GUI stays unchanged. I know I need to "loop" so the GUI stays open but I can't find a solution to replay the sound. I allready tried with a loop every 13 seconds but the doesn't seem to work neither. :(

login.au3

Link to comment
Share on other sites

it can be done via DllCall....see this link:PlaySound

These are the flag values from MmSystem.h(for MmSystem.dll)

*  flag values for fuSound and fdwSound arguments on [snd]PlaySound
 */
#define SND_SYNC            0x0000  /* play synchronously (default) */
#define SND_ASYNC           0x0001  /* play asynchronously */
#define SND_NODEFAULT       0x0002  /* silence (!default) if sound not found */
#define SND_MEMORY          0x0004  /* pszSound points to a memory file */
#define SND_LOOP            0x0008  /* loop the sound until next sndPlaySound */
#define SND_NOSTOP          0x0010  /* don't stop any currently playing sound */

#define SND_NOWAIT      0x00002000L /* don't wait if the driver is busy */
#define SND_ALIAS       0x00010000L /* name is a registry alias */
#define SND_ALIAS_ID    0x00110000L /* alias is a predefined ID */
#define SND_FILENAME    0x00020000L /* name is file name */
#define SND_RESOURCE    0x00040004L /* name is resource name or atom */
#if(WINVER >= 0x0400)
#define SND_PURGE           0x0040  /* purge non-static events for task */
#define SND_APPLICATION     0x0080  /* look for application specific association */
Edited by quaizywabbit
[u]Do more with pre-existing apps![/u]ANYGUIv2.8
Link to comment
Share on other sites

I made a script with a logon screen and some menu's. When the GUI opens there is a song playing for about 13 seconds ( I'm using Soundplay("sound.wav") ). I want the script to replay ( loop ) the sound while the rest of the GUI stays unchanged. I know I need to "loop" so the GUI stays open but I can't find a solution to replay the sound. I allready tried with a loop every 13 seconds but the doesn't seem to work neither.  :(

<{POST_SNAPBACK}>

How about making one script for playing the music and complie it and run that Exe from the other script and just use processclose to stop the music when your are done with it like in the file I have in the download.

.

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