I use the following code to play WAV files from Access. Is there a method to
play MP3 files from an Access event or control.:
'************************************************* ****
Option Compare Database
Option Explicit
Declare Function sndplaysound Lib "WINMM.DLL" Alias "sndPlaySoundA" (ByVal
lpszSoundName As String, ByVal uFlags As Long) As Long
Dim soundName As String
Dim WFlags As Integer
Dim x As Integer
Const SND_SYNC = &H0
Const snd_async = &H1
Const SND_NODEFAULT = &H2
Const SND_LOOP = &H8
Const SND_NOSTOP = &H10
Function PlayIt(soundName$)
Dim myPath As String
myPath = GetPath()
soundName$ = myPath & soundName$
WFlags% = snd_async
x% = sndplaysound(soundName$, WFlags%)
End Function
'************************************************* ***** 5 3759
On Mon, 19 Sep 2005 09:31:04 -0400, "Johnny M" <ne**@solutionsbymiller.com> wrote: I use the following code to play WAV files from Access. Is there a method to play MP3 files from an Access event or control.: '************************************************ ***** Option Compare Database Option Explicit
Declare Function sndplaysound Lib "WINMM.DLL" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long Dim soundName As String Dim WFlags As Integer Dim x As Integer
Const SND_SYNC = &H0 Const snd_async = &H1 Const SND_NODEFAULT = &H2 Const SND_LOOP = &H8 Const SND_NOSTOP = &H10 Function PlayIt(soundName$) Dim myPath As String myPath = GetPath()
soundName$ = myPath & soundName$ WFlags% = snd_async x% = sndplaysound(soundName$, WFlags%) End Function '************************************************ ******
Hi
I use
Dim i As Long
i = mciSendString("close voice1", 0&, 0, 0) 'precautionary
i = mciSendString("Open " & AudioPath & " Alias voice1", 0&, 0, 0)
i = mciSendString("play voice1", 0&, 0, 0)
where mciSendString is
Public Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As
String, ByVal lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As
Long
Thanks I got this function to work but it appears to require no spaces in
the name of the file or directory. Is there a work around for this?
Johnny
"polite person" <ge*******@ease.com> wrote in message
news:4g********************************@4ax.com... On Mon, 19 Sep 2005 09:31:04 -0400, "Johnny M" <ne**@solutionsbymiller.com> wrote:
I use the following code to play WAV files from Access. Is there a method to play MP3 files from an Access event or control.: '*********************************************** ****** Option Compare Database Option Explicit
Declare Function sndplaysound Lib "WINMM.DLL" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long Dim soundName As String Dim WFlags As Integer Dim x As Integer
Const SND_SYNC = &H0 Const snd_async = &H1 Const SND_NODEFAULT = &H2 Const SND_LOOP = &H8 Const SND_NOSTOP = &H10 Function PlayIt(soundName$) Dim myPath As String myPath = GetPath()
soundName$ = myPath & soundName$ WFlags% = snd_async x% = sndplaysound(soundName$, WFlags%) End Function '*********************************************** *******
Hi I use
Dim i As Long i = mciSendString("close voice1", 0&, 0, 0) 'precautionary i = mciSendString("Open " & AudioPath & " Alias voice1", 0&, 0, 0) i = mciSendString("play voice1", 0&, 0, 0)
where mciSendString is
Public Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
On Wed, 21 Sep 2005 16:52:55 -0400, "Johnny M" <ne**@solutionsbymiller.com> wrote: Thanks I got this function to work but it appears to require no spaces in the name of the file or directory. Is there a work around for this?
Johnny
Hi
call with extra quotes eg
AudioPath = """C:/funny name.mp3"""
"polite person" <ge*******@ease.com> wrote in message news:4g********************************@4ax.com.. . On Mon, 19 Sep 2005 09:31:04 -0400, "Johnny M" <ne**@solutionsbymiller.com> wrote:
I use the following code to play WAV files from Access. Is there a method to play MP3 files from an Access event or control.: '********************************************** ******* Option Compare Database Option Explicit
Declare Function sndplaysound Lib "WINMM.DLL" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long Dim soundName As String Dim WFlags As Integer Dim x As Integer
Const SND_SYNC = &H0 Const snd_async = &H1 Const SND_NODEFAULT = &H2 Const SND_LOOP = &H8 Const SND_NOSTOP = &H10 Function PlayIt(soundName$) Dim myPath As String myPath = GetPath()
soundName$ = myPath & soundName$ WFlags% = snd_async x% = sndplaysound(soundName$, WFlags%) End Function '********************************************** ********
Hi I use
Dim i As Long i = mciSendString("close voice1", 0&, 0, 0) 'precautionary i = mciSendString("Open " & AudioPath & " Alias voice1", 0&, 0, 0) i = mciSendString("play voice1", 0&, 0, 0)
where mciSendString is
Public Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Actually, I seem to recall it requires a short file name: it's not just the
spaces it's complaining about!
Check out http://www.mvps.org/access/api/api0020.htm at "The Access Web" for
how to determine the short file name for a given long file name.
--
Doug Steele, Microsoft Access MVP http://I.Am/DougSteele
(no e-mails, please!)
"Johnny M" <ne**@solutionsbymiller.com> wrote in message
news:IKjYe.88310$Zp.47317@lakeread04... Thanks I got this function to work but it appears to require no spaces in the name of the file or directory. Is there a work around for this?
Johnny
"polite person" <ge*******@ease.com> wrote in message news:4g********************************@4ax.com... On Mon, 19 Sep 2005 09:31:04 -0400, "Johnny M" <ne**@solutionsbymiller.com> wrote:
I use the following code to play WAV files from Access. Is there a method to play MP3 files from an Access event or control.: '********************************************** ******* Option Compare Database Option Explicit
Declare Function sndplaysound Lib "WINMM.DLL" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long Dim soundName As String Dim WFlags As Integer Dim x As Integer
Const SND_SYNC = &H0 Const snd_async = &H1 Const SND_NODEFAULT = &H2 Const SND_LOOP = &H8 Const SND_NOSTOP = &H10 Function PlayIt(soundName$) Dim myPath As String myPath = GetPath()
soundName$ = myPath & soundName$ WFlags% = snd_async x% = sndplaysound(soundName$, WFlags%) End Function '********************************************** ********
Hi I use
Dim i As Long i = mciSendString("close voice1", 0&, 0, 0) 'precautionary i = mciSendString("Open " & AudioPath & " Alias voice1", 0&, 0, 0) i = mciSendString("play voice1", 0&, 0, 0)
where mciSendString is
Public Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Thanks I used the getshortname function and it worked fine.
Johnny
"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:kK********************@rogers.com... Actually, I seem to recall it requires a short file name: it's not just the spaces it's complaining about!
Check out http://www.mvps.org/access/api/api0020.htm at "The Access Web" for how to determine the short file name for a given long file name.
-- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Johnny M" <ne**@solutionsbymiller.com> wrote in message news:IKjYe.88310$Zp.47317@lakeread04... Thanks I got this function to work but it appears to require no spaces in the name of the file or directory. Is there a work around for this?
Johnny
"polite person" <ge*******@ease.com> wrote in message news:4g********************************@4ax.com... On Mon, 19 Sep 2005 09:31:04 -0400, "Johnny M" <ne**@solutionsbymiller.com> wrote:
I use the following code to play WAV files from Access. Is there a method to play MP3 files from an Access event or control.: '********************************************* ******** Option Compare Database Option Explicit
Declare Function sndplaysound Lib "WINMM.DLL" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long Dim soundName As String Dim WFlags As Integer Dim x As Integer
Const SND_SYNC = &H0 Const snd_async = &H1 Const SND_NODEFAULT = &H2 Const SND_LOOP = &H8 Const SND_NOSTOP = &H10 Function PlayIt(soundName$) Dim myPath As String myPath = GetPath()
soundName$ = myPath & soundName$ WFlags% = snd_async x% = sndplaysound(soundName$, WFlags%) End Function '********************************************* *********
Hi I use
Dim i As Long i = mciSendString("close voice1", 0&, 0, 0) 'precautionary i = mciSendString("Open " & AudioPath & " Alias voice1", 0&, 0, 0) i = mciSendString("play voice1", 0&, 0, 0)
where mciSendString is
Public Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Brian Basquille |
last post by:
Hello all,
What is the syntax for simply playing a WAV file in your program?
Am learning VB and have two VB books but don't wanna root through them to
find the code.
Any help would be much...
|
by: SOB-like MIDIs |
last post by:
The applet for endlessly rising/falling scale
(auditory illusion)
on this page is fantastic!
http://www.cs.ubc.ca/nest/imager/contributions/flinn/Illusions/ST/st.html
How is this done?...
|
by: Peter Schmitz |
last post by:
Hi,
I'm just trying to play a *.wav file, making use of the unmanaged function
"sndPlaySoundA" in winmm.dll, but I still got one question: How can I avoid,
that the sound file itself has to be...
|
by: Les Juby |
last post by:
Hi
A clint has insisted we load a babbling brook sound clip to his home
page but it needs to load last to avoid delays in loading images and
other elements.
Simply declaring it at page bottom...
|
by: Lee Moody |
last post by:
I just want quick and easy way to play a .wav file out the
standard sound device. It could even be as simple as
activating a sound assigned to an existing windows sound
event.
Any suggestions?...
|
by: Brent |
last post by:
Hi, I want to recreate my own version of http://snakesonaplane.varitalk.com/
.. So basically I want to start with a basic, make the modem dial a number
and play a soundclip to the person that...
|
by: oops |
last post by:
I've had no luck getting 2 sound files to start at the same time. the second one to start is delayed by about 3/4 of a second. Also would also prefer to start another clip a given point when one of...
|
by: gazza67 |
last post by:
Hi,
Does anyone know how to check for when a sound has finished playing?
I am currently using the SoundPlayer, there doesnt seem to be any
event for this - am I missing something?
Gary
|
by: Jack |
last post by:
Hi,
I'm writing a simple wav player (like winamp) and using the
SoundPlayer class in c# 2005.
Using winform buttons, I can begin playing the sound and stop half-way
through the sound using:...
|
by: chromis |
last post by:
Hi,
I've been struggling to get sounds to work with attachSound when the sounds are stored in a swf loaded into another swf. I came across a post on a forum which supposedly explains how to to do...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
| |