Go Back   Access World Forums > Microsoft Access Reference > Access FAQs

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
Old 07-04-2009, 07:54 PM   #1
ajetrumpet
Banned
 
Join Date: Jun 2007
Location: Universe - Local Group - Milky Way Galaxy - Orion Arm
Posts: 5,640
Thanks: 0
Thanked 97 Times in 44 Posts
ajetrumpet has a spectacular aura about ajetrumpet has a spectacular aura about
Send a message via MSN to ajetrumpet Send a message via Yahoo to ajetrumpet
Play VB/HTML .Wav (Wave) Files

Here is some code you can use to play .Wav files in your database:
Code:
Option Compare Database
Option Explicit

Public MusicPlay As Long

Public Const SND_SYNC = &H0

Public Const SND_NODEFAULT = &H2
 
Declare Function SndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
                (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Play your .Wav files using the "MusicPlay" variable:
Code:
Function PlayFile()

   MusicPlay = SndPlaySound("FULL PATH OF .WAV FILE", SND_SYNC + SND_NODEFAULT)

End Function
I incorporated some background voices on a website recently, so I'll add the small piece of code I used to play .Wav's on the webpages too...

This script goes before the BODY tags:
Code:
<script type="text/javascript">
function EvalSound(soundobj) {
  var thissound=document.getElementById(soundobj);
  thissound.Play();
}
</script>

<embed src="FULL PATH AND EXTENSION OF FILE" autostart=false loop="false" 
width=0 height=0 id="sound1" enablejavascript="true">
This is the start of the BODY tag:
Code:
<body onLoad="EvalSound('sound1');"


Last edited by ajetrumpet; 07-17-2009 at 11:47 PM.
ajetrumpet is offline  
The Following User Says Thank You to ajetrumpet For This Useful Post:
hassanogaibi (06-28-2016)
Old 07-06-2009, 04:51 AM   #2
HiTechCoach
Newly Registered User
 
HiTechCoach's Avatar
 
Join Date: Mar 2006
Location: Oklahoma City, OK
Posts: 4,243
Thanks: 8
Thanked 155 Times in 143 Posts
HiTechCoach is a jewel in the rough HiTechCoach is a jewel in the rough HiTechCoach is a jewel in the rough HiTechCoach is a jewel in the rough
Re: Play .Wav (Wave) Files

Also see:

Play MIDI/Avi/Wav files
__________________
Boyd Trimmell
Specializing in Accounting, CRM, and Business solutions
Microsoft Access MVP 2010-2015 , aka
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
HiTechCoach is offline  
The Following User Says Thank You to HiTechCoach For This Useful Post:
hassanogaibi (06-28-2016)
Closed Thread

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Access 97 won't play with .xls files visacrum General 15 09-23-2008 10:09 AM
Playing A Sound File (.wav / .mid) rapsr59 Modules & VBA 3 07-30-2008 03:28 PM
How to embed and play wav files into a form? John Baker Forms 26 04-30-2006 08:34 AM
[SOLVED] Play .wav files Anna'sProblem Forms 2 06-14-2001 02:53 AM




All times are GMT -8. The time now is 05:59 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World