By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,490 Members | 896 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,490 IT Pros & Developers. It's quick & easy.

Access is using something to play audio files. How can I find out what it is?

P: n/a
MLH
I have some audio help files that play fine from within Access 97
and Access 2.0. Both are running on a Windows XP box. But I
do not know what program plays the files.

If I click Start, Run and type in c:\MyApp\MyHelp\Help1.wav,
Windows Media Player tries unsuccessfully to play the wav file.
It err's saying ClassFactory cannot supply the requested class.
But WMP has no problem at all playing c:\windows\system32\
ALSNDMGR.WAV. That goes off without a hitch.

I'm quite certain that Access is not playing sounds with WMP.
So, what is it using?
Nov 13 '05 #1
Share this Question
Share on Google+
22 Replies


P: n/a
MLH <CR**@NorthState.net> wrote in news:m3lvc19tjrrbleo1e8hhugitjbkn3h9et9@
4ax.com:
I'm quite certain that Access is not playing sounds with WMP.
So, what is it using?


QuickTime?
Nov 13 '05 #2

P: n/a
MLH
It has been suggested that Access is using Quick Time
to play audio files. How can I determine what Access is
using to play the files?
Nov 13 '05 #3

P: n/a
> It has been suggested that Access is using Quick Time
to play audio files. How can I determine what Access is
using to play the files?


You could try looking in the process list under task manager.

Take a look before and during file play - see which process are new, then if
the name is not obvious google it.

Also you could try looking at the file mapping for wav files to see which it
is associated with.

HTH

Diablo
Nov 13 '05 #4

P: n/a
MLH
Thx Diablo.

I'll try the first of you suggestions. I already know the latter, as
the wav extension file association setting is for Windows Media
Player. That's what launches when I dbl-click a wav file. I'm curious
to know if Access has a setting that specifies the player to use.

You could try looking in the process list under task manager.

Take a look before and during file play - see which process are new, then if
the name is not obvious google it.

Also you could try looking at the file mapping for wav files to see which it
is associated with.

HTH

Diablo


Nov 13 '05 #5

P: n/a
MLH
I looked at both the process list and the applications list in there.
Nothing changes when I play an audio file to indicate what tool
is playing it. My app shows as "not responding" during the play.
I would have expected that. Its as if the player takes control of
the entire application. I can't click anything during audio play,
keystrokes are ignored. The app is LOCKED during that time.

I did sometimes see the application name come up a 2nd time
in Windows Task Manager's Applications tab. But I saw no
changes under the Processes tab. That's disappointing.
Nov 13 '05 #6

P: n/a
MLH
I also noted that CPU usage stays quite low (2% - 3%) during audio
play. This is the normal level I see if I'm doing nothing at the
console - no mouse or keyboard activity. That would have been
predictable, as the audio file is uncompressed. Nothing happening
but I/O.
Nov 13 '05 #7

P: n/a
MLH wrote:
It has been suggested that Access is using Quick Time
to play audio files. How can I determine what Access is
using to play the files?


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Some suggestions:

Look in the application for a file name that has the QuickTime
extension, which I don't know. Probably .qt or something like that.

Where in your application does the tune play? If it's in a form, then
what happens before the tune plays? Open the form in design view & go
to the event that occurs before the tune plays and see if there is a
file name w/ a weird extension or the QT extension.

Place a Breakpoint on the event procedure that occurs before the tune.
Run the event. Step thru the VBA commands until the tune plays - what
command occurred before the tune played? There's probably a file name
there, or a reference to one.

If that doesn't work, then - is there an ActiveX control on the form?
Does it have a file name property that indicates a QT file?

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQtFraYechKqOuFEgEQIstQCeLLIUnj5Os6wSvDmu9f45HY xtZxoAnjQM
j3ROkW35Xdn29Gq9clfltnqi
=KVKM
-----END PGP SIGNATURE-----
Nov 13 '05 #8

P: n/a
MLH
Here's the code line invoking play of audio file...
PlayHelp = fPlayStuff("C:\Program Files\TowPack\help\Help-101.wav", 0)

And here's my standard module (basSoundFNs) contents...
'****************** Code Start *********************
' This code was originally written by Dev Ashish.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Dev Ashish
'
Public Const pcsSYNC = 0 ' wait until sound is finished playing
Public Const pcsASYNC = 1 ' don't wait for finish
Public Const pcsNODEFAULT = 2 ' play no default sound if sound doesn't
exist
Public Const pcsLOOP = 8 ' play sound in an infinite loop (until
next apiPlaySound)
Public Const pcsNOSTOP = 16 ' don't interrupt a playing sound

'Sound APIs
Private Declare Function apiPlaySound Lib "Winmm.dll" Alias
"sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

'AVI APIs
Private Declare Function apimciSendString Lib "Winmm.dll" Alias
"mciSendStringA" _
(ByVal lpstrCommand As String, ByVal lpstrReturnString As String,
_
ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long

Private Declare Function apimciGetErrorString Lib "Winmm.dll" _
Alias "mciGetErrorStringA" (ByVal dwError As Long, _
ByVal lpstrBuffer As String, ByVal uLength As Long) As Long
Function fPlayStuff(ByVal strFilename As String, _
Optional intPlayMode As Integer) As Long
'MUST pass a filename _with_ extension
'Supports Wav, AVI, MID type files
Dim lngRet As Long
Dim strTemp As String

Select Case LCase(fGetFileExt(strFilename))
Case "wav":
If Not IsMissing(intPlayMode) Then
lngRet = apiPlaySound(strFilename, intPlayMode)
Else
MsgBox "Must specify play mode."
Exit Function
End If
Case "avi", "mid":
strTemp = String$(256, 0)
lngRet = apimciSendString("play " & strFilename, strTemp,
255, 0)
End Select
fPlayStuff = lngRet
End Function
Function fStopStuff(ByVal strFilename As String)
'Stops a multimedia playback
Dim lngRet As Long
Dim strTemp As String
Select Case LCase(fGetFileExt(strFilename))
Case "Wav":
lngRet = apiPlaySound(0, pcsASYNC)
Case "avi", "mid":
strTemp = String$(256, 0)
lngRet = apimciSendString("stop " & strFilename, strTemp,
255, 0)
End Select
fStopStuff = lngRet
End Function

Private Function fGetFileExt(ByVal strFullPath As String) As String
Dim intPos As Integer, intLen As Integer
intLen = Len(strFullPath)
If intLen Then
For intPos = intLen To 1 Step -1
'Find the last \
If Mid$(strFullPath, intPos, 1) = "." Then
fGetFileExt = Mid$(strFullPath, intPos + 1)
Exit Function
End If
Next intPos
End If
End Function

Function fGetError(ByVal lngErrNum As Long) As String
' Translate the error code to a string
Dim lngx As Long
Dim strErr As String

strErr = String$(256, 0)
lngx = apimciGetErrorString(lngErrNum, strErr, 255)
strErr = left$(strErr, Len(strErr) - 1)
fGetError = strErr
End Function
Function fatest()
Dim a As Long
a = fPlayStuff("C:\winnt\clock.avi")
'a = fStopStuff("C:\winnt\clock.avi")
End Function

'****************** Code End *********************

Nov 13 '05 #9

P: n/a
MLH wrote:
Here's the code line invoking play of audio file...
PlayHelp = fPlayStuff("C:\Program Files\TowPack\help\Help-101.wav", 0)

And here's my standard module (basSoundFNs) contents...
'****************** Code Start *********************
' This code was originally written by Dev Ashish.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Dev Ashish
'
Public Const pcsSYNC = 0 ' wait until sound is finished playing
Public Const pcsASYNC = 1 ' don't wait for finish
Public Const pcsNODEFAULT = 2 ' play no default sound if sound doesn't
exist
Public Const pcsLOOP = 8 ' play sound in an infinite loop (until
next apiPlaySound)
Public Const pcsNOSTOP = 16 ' don't interrupt a playing sound

'Sound APIs


The above "Sound APIs" suggests that there is a Windows core library capable of
playing sound. I would guess that Media Player makes calls to those same APIs
and that in fact Access is not using ANY *program* to play those sound files.
It is using the same API calls that other media programs might call. I am sure
that Access can produce sounds when Media Player is not even installed.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #10

P: n/a
On Sun, 10 Jul 2005 15:08:18 -0400, MLH <CR**@NorthState.net> wrote:
Here's the code line invoking play of audio file...
PlayHelp = fPlayStuff("C:\Program Files\TowPack\help\Help-101.wav", 0)

<snip>

Hi
This uses MCI, a whole set of routines which have been built in to
Windows for yonks. As newer ways have been introduced of doing most of
these things and new media types have been introduced, MCI has been
suggested as a likely candidate for being phased out of new versions
of Windows. Apparently it was dropped in one of the 64 bit test
versions until someone found they could no longer play CDs on the
machine.
David

Nov 13 '05 #11

P: n/a
MLH
Thx, David. What the heck is MCI and what the heck is
Windows for Yonks? I've heard of Windows for Workgroups.
Is there a better tool to play audio I should be using? The
audio files are voice help files for the visually impaired and
they certainly don't need any Hi-Fi to be played suitably.

Hi
This uses MCI, a whole set of routines which have been built in to
Windows for yonks. As newer ways have been introduced of doing most of
these things and new media types have been introduced, MCI has been
suggested as a likely candidate for being phased out of new versions
of Windows. Apparently it was dropped in one of the 64 bit test
versions until someone found they could no longer play CDs on the
machine.
David


Nov 13 '05 #12

P: n/a
On Sun, 10 Jul 2005 16:51:30 -0400, MLH <CR**@NorthState.net> wrote:
Thx, David. What the heck is MCI and what the heck is
Windows for Yonks? I've heard of Windows for Workgroups.
Is there a better tool to play audio I should be using? The
audio files are voice help files for the visually impaired and
they certainly don't need any Hi-Fi to be played suitably.
Hi
MCI stands for Media Control Interface, it consists of a large number
of messages and functions, built in to the Windows operating system,
see
http://msdn.microsoft.com/library/de...rface_mci_.asp
but I don't think you should mess with it.

"Yonks" is dated UK slang for "a long time", ie the MCI system goes
back to early versions of Windows.

I also have produced sound output for visually impaired; from VB I use
the MCI interface just as you are doing, and from web applications I
use media player (or ar whatever the browser has been set up to use),
Real Media which I never use, is an alternative. On the web, for
speech, instead of WAV files I use MP3 at 32 bits, which is about 10
times smaller than WAV.

You can also generate synthetic speech direct from text, a free
version comes with modern Windows systems, program it using SAPI. It
uses much less storage than real speech and is much easier to modify
or create on demand, but is not at all realistic. Hear an example by
going to the control panel, then Speech, Text to speech. Excuse me if
you know all this.

SAPI can also be used over the web in principle but as it uses an
ActiveX it throws up warnings on most people's brower. and is not
platform independent.
David



Nov 13 '05 #13

P: n/a
MLH <CR**@NorthState.net> wrote in
news:7b********************************@4ax.com:
I also noted that CPU usage stays quite low (2% - 3%) during audio
play. This is the normal level I see if I'm doing nothing at the
console - no mouse or keyboard activity. That would have been
predictable, as the audio file is uncompressed. Nothing happening
but I/O.


Have you tried putting in a DoEvents before and/or after the line
you're calling?

It appears that your API call is executing sequentially, not
asynchronously, as you'd be likely to expect. That is, you'd expect
the sound to launch it's own independent thread and return control
to the keyboard/mouse/etc, but it appears not to be. Perhaps it's
not possible with the MCI interface. I dunno!

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #14

P: n/a

Sorry, the MCI section actually starts at

http://msdn.microsoft.com/library/de...start_page.asp

David

Nov 13 '05 #15

P: n/a
On Sun, 10 Jul 2005 23:58:44 GMT, "David W. Fenton"
<dX********@bway.net.invalid> wrote:
MLH <CR**@NorthState.net> wrote in
news:7b********************************@4ax.com :
I also noted that CPU usage stays quite low (2% - 3%) during audio
play. This is the normal level I see if I'm doing nothing at the
console - no mouse or keyboard activity. That would have been
predictable, as the audio file is uncompressed. Nothing happening
but I/O.


Have you tried putting in a DoEvents before and/or after the line
you're calling?

It appears that your API call is executing sequentially, not
asynchronously, as you'd be likely to expect. That is, you'd expect
the sound to launch it's own independent thread and return control
to the keyboard/mouse/etc, but it appears not to be. Perhaps it's
not possible with the MCI interface. I dunno!

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc


Hi MLH
If you look carefully at the routine fPlayStuff which you are using
(it is posted in the other threadlet) you will see that the second
argument controls the mode of play.
I also see that in your function call you are using zero rather than
the constant mentioned in the routine, which is not good practice.

Public Const SND_SYNC = &H0 ' play synchronously (default)
Public Const SND_ASYNC = &H1 ' play asynchronously

regards
David
Nov 13 '05 #16

P: n/a
MLH
Thx. Will have a go at it and see what turns up.
I appreciate your comments and your time - never
take them for granted.
xxxxxxxxxxxxxxxxxxxxxxxxxx

Sorry, the MCI section actually starts at

http://msdn.microsoft.com/library/de...start_page.asp

David


Nov 13 '05 #17

P: n/a
MLH
MCI stands for Media Control Interface, it consists of a large number
of messages and functions, built in to the Windows operating system,
see
http://msdn.microsoft.com/library/de...rface_mci_.asp
but I don't think you should mess with it.

"Yonks" is dated UK slang for "a long time", ie the MCI system goes
back to early versions of Windows. Yonks. I like it. It seems like I've been at this for Yonks.
I also have produced sound output for visually impaired; from VB I use
the MCI interface just as you are doing, and from web applications I
use media player (or ar whatever the browser has been set up to use),
Real Media which I never use, is an alternative. On the web, for
speech, instead of WAV files I use MP3 at 32 bits, which is about 10
times smaller than WAV. Yes, MP3 saves on valuable bandwidth.
You can also generate synthetic speech direct from text, a free
version comes with modern Windows systems, program it using SAPI. It
uses much less storage than real speech and is much easier to modify
or create on demand, but is not at all realistic. Hear an example by
going to the control panel, then Speech, Text to speech. Excuse me if
you know all this. Have only played with it. Nothing serious.
SAPI can also be used over the web in principle but as it uses an
ActiveX it throws up warnings on most people's brower. and is not
platform independent.
David

Thx for all, David.
Nov 13 '05 #18

P: n/a
MLH
Now there you go. That sounds logical. Thx, Rick.

The above "Sound APIs" suggests that there is a Windows core library capable of
playing sound. I would guess that Media Player makes calls to those same APIs
and that in fact Access is not using ANY *program* to play those sound files.
It is using the same API calls that other media programs might call. I am sure
that Access can produce sounds when Media Player is not even installed.


Nov 13 '05 #19

P: n/a
MLH
<xnip>
I changed to using 1 after reading your post, using the defined
constant rather than the value 1. I agree, I think that's a better
idea.

I changed to using 1 after reading your post, using the defined
constant rather than the value 1. I agree, I think that's a better
idea.
Hi MLH
If you look carefully at the routine fPlayStuff which you are using
(it is posted in the other threadlet) you will see that the second
argument controls the mode of play.
I also see that in your function call you are using zero rather than
the constant mentioned in the routine, which is not good practice.

Public Const SND_SYNC = &H0 ' play synchronously (default)
Public Const SND_ASYNC = &H1 ' play asynchronously

regards
David

I like the behaviour better now. I can navigate with the mouse. But
it still won't let me stop the recording from playing. I tried calling

Function fStopStuff(ByVal strFilename As String)
'Stops a multimedia playback
Dim lngRet As Long
Dim strTemp As String
Select Case LCase(fGetFileExt(strFilename))
Case "Wav":
lngRet = apiPlaySound(0, pcsASYNC)
Case "avi", "mid":
strTemp = String$(256, 0)
lngRet = apimciSendString("stop " & strFilename, strTemp,
255, 0)
End Select
fStopStuff = lngRet
End Function
.... sending it the full path & filename argument. All that happens is
my computer beeps at me after executing the line...
lngRet = apiPlaySound(0, pcsASYNC)
but the wav file just keeps on playing until the EOF. Do you see
anything wrong with the syntax of the api call? I have verified that
lngRet = apiPlaySound(0, pcsASYNC)
is actually executed and is responsible for the beep I'm hearing.
Nov 13 '05 #20

P: n/a
Br
MLH <CR**@NorthState.net> wrote:
Now there you go. That sounds logical. Thx, Rick.

The above "Sound APIs" suggests that there is a Windows core library
capable of playing sound. I would guess that Media Player makes
calls to those same APIs and that in fact Access is not using ANY
*program* to play those sound files. It is using the same API calls
that other media programs might call. I am sure that Access can
produce sounds when Media Player is not even installed.


DirectSound perhaps?
--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
Nov 13 '05 #21

P: n/a
MLH
BTW, Function fStopStuff's return value is 1. I don't
know what that stands for, but perhaps it provides
a clue as to why it fails to suspend the playback.
Nov 13 '05 #22

P: n/a
Hi
Here is some code I have used (in VB) when I needed to interrupt
playback. I used a timer to check when playing has ended (the original
code has a video in it as well and I needed to know which finished
when) so this may not be suitable for you.
David

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
Public mssgV As String * 255
Public Sub PlayAudio(AudioPath As String)

On Error GoTo err_PlayAudio
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)
Exit Sub

err_PlayAudio:
MsgBox Err.Description & " (" & Err.Number & ")", vbExclamation,
"modMultiMedia.PlayAudio"
End Sub
Public Sub ClosePlayAudio()

''On Error GoTo err_ClosePlayAudio

Dim i As Long
i = mciSendString("close voice1", 0&, 0, 0)
Exit Sub

err_ClosePlayAudio:
MsgBox Err.Description & " (" & Err.Number & ")", vbExclamation,
"modMultiMedia.ClosePlayAudio"
End Sub

Private Sub tmrSound_Timer()

''On Error GoTo err_tmrSound

Dim iSound As Long
'get status, checking if "stop"
iSound = mciSendString("status voice1 mode", mssgS, 255, 0)
If left$(mssgS, 4) = "stop" Then
iSound = mciSendString("close voice1", 0&, 0, 0) 'must
close it!
tmrSound.Enabled = False ' = True needs setting for
next sound
ClosePlayAudio
End If

Exit Sub

err_tmrSound:
MsgBox Err.Description & " (" & Err.Number & ")", vbExclamation,
"frmKiosk.tmrSound"
End Sub

Nov 13 '05 #23

This discussion thread is closed

Replies have been disabled for this discussion.