Hey guys, i need a wave sound file for my program i am working for a basic tutorial for grade school and pre-scool so i am looking for a sound file that fitted to my quiz in pre-school i can`t find in google or to any sites..
you must locate your sound file (abcd.wav) at the dirrectory that contain vb6 application.
private sub cmd1_click() on error resume next soundfile= App.path & "/" & "abcd.wav" returnaval=playsound(soundfile, 0, &H0) Endsub
hope this will help you.
Edited 4 Years Ago by mahela
sorry I forgot the most improtant part.please use below code set.
Private Declare Function PlaySound Lib _ "winmm.dll" _ (ByVal lpszName As String, ByVal _ hModule As Long, ByVal dwFlags As Long) As Long private sub cmd1_click() on error resume next soundfile= App.path & "/" & "abcd.wav" returnaval=playsound(soundfile, 0, &H0) Endsub
sorry for the lost code set.enjoy now.
The code is perfectly fine, but what i understand from the question is the OP is aking for a wave file not how to play it. OP needs a file not the code to open it.
Your problem is the first opportunity for me to finally post something here.
Your quiz software is probably very specific therefore you cannot find anything that will fill your needs . I had the same situation some time ago and found the following solution;
You can record your own wave using Audacity (freeware) then save it using whatever name you and directory you wish then in your Form declaration section insert the following code ( on 1 line )
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Insert the following code in the command button ( or whatever else you are using) to play the file.
retval = PlaySound("C:\wave directory name\filename.wav", 0&, &H20000)
Remember to change the directory name and filename to coincide with yours
I hope it solves the problem for you as it did for me
Hi. so this is actually a continuation from another question of mineHere but i was advised to start a new thread as the original question was already answered.
This is the result of previous question answered :
code for the listbox - datagridview interaction
At the top of the code ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.
Private Sub btn_addline_Click(ByVal ...