473,406 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to Link a Sound Wav File to a Button

547 512MB
I would like to link a wav sound file to a button in my Access 2007 application. Has anybody got code to do it?
Its for a race timing application and i want to have a "gunshot" sound when the athletes take off at start of race.
pls help
Nov 17 '10 #1

✓ answered by ADezii

Copy both the Demo Database and the Gunshot.wav File in the Attachment to the same Folder. It doesn't matter where the Folder is, as long as the *.mdb and *.wav reside in the same Folder. Open the Database, then Click on the Command Button. Let me know how you make out.

7 7898
ADezii
8,834 Expert 8TB
Copy both the Demo Database and the Gunshot.wav File in the Attachment to the same Folder. It doesn't matter where the Folder is, as long as the *.mdb and *.wav reside in the same Folder. Open the Database, then Click on the Command Button. Let me know how you make out.
Attached Files
File Type: zip Play Sounds.zip (18.4 KB, 812 views)
Nov 17 '10 #2
neelsfer
547 512MB
can i use it with the Access 2007 format -noticed you used .mdb file in message about it?
Nov 18 '10 #3
ADezii
8,834 Expert 8TB
I can't see why not.
Nov 18 '10 #4
neelsfer
547 512MB
i have this problem. See attached screenpic. Changed the button to your button name. I changed the soundfile and that works in your example in my directory that i use.It just refuses to make any noise in my application. any suggestions?
Attached Images
File Type: jpg sounderror.jpg (45.3 KB, 618 views)
Nov 18 '10 #5
ADezii
8,834 Expert 8TB
Do you have the following Declarations in a Standard Code Module?
Expand|Select|Wrap|Line Numbers
  1. Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
  2.  
  3. Public Const SND_ASYNC = &H1
  4. Public Const SND_SYNC = &H0
  5. Public Const SND_LOOP = &H8
Nov 18 '10 #6
neelsfer
547 512MB
working 100% thx you are STAR!!
Nov 18 '10 #7
ADezii
8,834 Expert 8TB
You are quite welcome.
Nov 18 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Paul Moore | last post by:
Does anyone know of a Python library which handles sound file formats (MP3, Ogg, FLAC are the three I'm nost interested in). I'd like something that can manipulate "metadata" - stuff like artist,...
4
by: HKannen | last post by:
Hi everybody, I'd like to create a link to a file instead of copying the file to the new destination. Is there a possibility to do this ? Is there something like a Link Object in C# .NET ? ...
1
by: Vanessa | last post by:
Anyone know how to embed sound file to vb.net project, then play the sound file? I have searched the web for example... and download the example and when run, it works perfectly. But when i...
3
by: THE BAT | last post by:
I want to Play a sound file that of .wav . But without using of Windows Media Player Lib.
1
by: Lam | last post by:
how can I play sound file in a .aspx page written in C#? I try to use the code like the following. But whenI call the play function play("sound.wav", this.SND_ASYNC) my computer give out "be"...
6
by: martin1 | last post by:
Hi, All, The app retrieve sound.wav file from my loacal C drive, is there anyway the sound file can be stored in the app? then when building, it goes with app rather than sending sound file...
2
by: hayz | last post by:
Flash sound file looping problems hello there I'm definitely a newb so please bare some patience. I have a flash sound file on the index page of a site i'm working on. First off i need the...
4
by: ja5on | last post by:
hi, could u please help me on a query. i wanna add a sound file into my c# work, and when it is running, clicking on a button will trigger it to sound. (i'm making it works as an alarm thing). i...
2
by: geethapriya | last post by:
How can i output sound on button press in java? I've used Jframe for button creation! Plz help me!! All i need is a simple beep sound when the button is pressed!
4
by: dennijr | last post by:
how do i get vb6 to play a short MP3 sound file when i click a button, if its even possible. ive looked around and found some vb6 MP3 players, so i asume it is possible, but mostly all im finding is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.