\'Denne del skal ind i et almindeligt modul før det virker:
\'32-bit Declares for PlaySound & sndPlaySound Declare Function sndPlaySound Lib \"winmm.dll\" Alias \"sndPlaySoundA\" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long \'The parameter lpszSoundName is the path & filename of the WAV file \'you want to play. uFlags is used to specify different ways to play \'the sound. See the constants below.
Declare Function PlaySound Lib \"winmm.dll\" Alias \"PlaySoundA\" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long \'The parameter lpszName is the path & filename of the WAV file you \'want to play. hModule is the name of the module where the sound \'resource can be found if the sound is part of a resource file. \'dwFlags is used to specify the type of sound lpszName specifies.
\'Beskrivelse til delen i modulet:
\'Constants used by the uFlags parameter Public Const SND_SYNC = &H0 \'The sound is played synchronously. The \'function does not return until the sound ends. Public Const SND_ASYNC = &H1 \'The sound is played asynchronously. The \'function returns immediately after beginning \'the sound. To terminate an asynchronously \'played sound, call SndPlaySound with \'lpszSoundName set to \"\" Public Const SND_NODEFAULT = &H2 \'If the specified sound cannot be played, the \'function does not play the default sound. Public Const SND_MEMORY = &H4 \'The parameter specified by lpszSoundName \'points to an in-memory image of a wave- \'form sound. Use this if your sounds are part \'of a resource file. Public Const SND_LOOP = &H8 \'The sound continues to play repeatedly until \'sndPlaySound is called again with \'lpsSoundName set to \"\". You must also \'specify the SND_ASYNC flag to loop \'sounds. Public Const SND_NOSTOP = &H10 \'If a sound is currently playing, the function \'immediately returns FALSE without playing \'the specified sound.
\'i et module Public Declare Function mciSendString Lib \"winmm.dll\" Alias \"mciSendStringA\" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long \' Det hele skal hænge sammen
\'Afspiller en lyd Private Sub Command1_CommandButton() Dim PHT As Long PHT = mciSendString(\"play c:\\LYD.wav\", 0, 0&, 0& ) End Sub
--> tdaugaard, det du svarer med, var ikke det jeg ville frem til så derfor...
--> webcrawler, hmm er det ikke bare det samme som tdaugaard?
Jeg ville gerne have nogle så kaldte \"lydkoder\" som BEEP, men da de ikke findes, og i har svaret på noget lidt andet, så vil jeg give jer pointene fordelt ud over jer alle sammen!
--> hmm, tdaugaard har jo allerede svaret at der kun findes lydkode BEEP...
Jeg har aldrig ville have nogen kode til at afspille lydfiler...
/jsc
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.