Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / September 2005

Tip: Looking for answers? Try searching our database.

Please Help Me! trying to play AVI file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Russ - 17 Sep 2005 14:56 GMT
Found this code to play MIDI, WAV, or AVI files at the following URL ...

http://www.mvps.org/access/api/api0011.htm

But having problems with this code (well at least what I want it to do)
Private Sub cmdPlayAvi_Click()
Dim a As Long
Dim cnn As ADODB.Connection
Dim dbname As String
Set cnn = CurrentProject.Connection
dbname = cnn.Properties("data source")
MyPath= getpath(dbname) & "\AVI\demo.avi"  'tried this but did not do the
trick
a = fPlayStuff("C:\Documents and Settings\Russell\Desktop\RRDW My Database\
AVI\Clock.avi")
End Sub
'problem seems to be that there are spaces between the names of the folders i.
e. Documents and Settings
'I figured someone always moves the database so I do not want to hard code it.

("C:\Windows\demo.avi")
'any suggestions
Paul - 19 Sep 2005 12:15 GMT
Russ

I have tried the code and It works ok.

here is a working copy for you to look at :

http://www.paulwest.me.uk/accessstuff/avi.zip

Put the DB and Avi in youy mydocuments folder.

Paul

> Found this code to play MIDI, WAV, or AVI files at the following URL ...
>
[quoted text clipped - 18 lines]
> ("C:\Windows\demo.avi")
> 'any suggestions
Russ - 19 Sep 2005 15:50 GMT
Paul, thanks...

But can you please explain a couple of thing?
in your line of code: fPlayStuff "clock.avi", 10 (what does the 10 stand for?)

Where are you telling it to look in My Documents for the file?
Can you please explain?

Thanks agian.

>Russ
>
[quoted text clipped - 13 lines]
>> ("C:\Windows\demo.avi")
>> 'any suggestions
Douglas J Steele - 19 Sep 2005 16:58 GMT
It's actually meaningless in the case of AVI or MID files.

For WAV files, look at the defined constants at
http://www.mvps.org/access/api/api0011.htm

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

10 would be the combination of using pcsNODEFAULT and pcsLOOP. In other
words, it's won't play a default sound if the file passed doesn't exist. If
it does exist, it's going to play it forever.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Paul, thanks...
>
[quoted text clipped - 23 lines]
> >> ("C:\Windows\demo.avi")
> >> 'any suggestions
Russ - 19 Sep 2005 19:15 GMT
thanks.

Where are you telling it to look in My Documents for the file?

>It's actually meaningless in the case of AVI or MID files.
>
[quoted text clipped - 17 lines]
>> >> ("C:\Windows\demo.avi")
>> >> 'any suggestions
Russ - 19 Sep 2005 20:19 GMT
Paul, I only put the Avi file in the My Documents folder, the database is on
my desktop and it works. So I assumed that you were pointing to it via code.

My problem is I figured someone always moves the database so I do not want to
hard code it. I wanted to make it look in a folder called AVI where the
database was installed and or moved to. tried this, but it did not work.

MyPath= getpath(dbname) & "\AVI\Clock.avi"
a = fPlayStuff("MyPath")
End Sub
'problem seems to be that there are spaces between the names of the folders
i.e. Documents and Settings or program files

Any ideas?

>thanks.
>
[quoted text clipped - 5 lines]
>>> >> ("C:\Windows\demo.avi")
>>> >> 'any suggestions
Paul - 19 Sep 2005 19:58 GMT
Russ

I have not specified a folder within the code. I used the MyDocuments folder
as an example as you used this in your original code.

because no folder is specified the code looks in the same folder as the DB.

Paul


> Found this code to play MIDI, WAV, or AVI files at the following URL ...
>
[quoted text clipped - 18 lines]
> ("C:\Windows\demo.avi")
> 'any suggestions
Paul - 19 Sep 2005 20:37 GMT
Russ

I have come across this problem of spaces with folder names and never been
able to solve it. I nows always create folders, sub folders etc with no
spaces.

I think this problems is one for the MVP's.

Paul

> Found this code to play MIDI, WAV, or AVI files at the following URL ...
>
[quoted text clipped - 18 lines]
> ("C:\Windows\demo.avi")
> 'any suggestions
Douglas J. Steele - 19 Sep 2005 23:19 GMT
IIRC, the MCI APIs will only work with short file names. Fortunately, there
are APIs that will translated between LFN and SFN. See
http://www.mvps.org/access/api/api0020.htm

However, when I was doing some tests for this question, I found that there
were certain AVI files that didn't seem to work with the MCI APIs,
regardless of whether it was a long or short file name.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Russ
>
[quoted text clipped - 31 lines]
>> ("C:\Windows\demo.avi")
>> 'any suggestions
Russ - 20 Sep 2005 15:53 GMT
Is there other options for playing AVI fils?
Is there any way to play MPEG, is that any better?

>IIRC, the MCI APIs will only work with short file names. Fortunately, there
>are APIs that will translated between LFN and SFN. See
[quoted text clipped - 9 lines]
>>> ("C:\Windows\demo.avi")
>>> 'any suggestions
Douglas J. Steele - 20 Sep 2005 23:22 GMT
I'm sure that if you've got a compliant client that exposes itself to
automation, you could do something there. Unfortunately, I haven't needed to
do anything like this, so I've never looked into it.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Is there other options for playing AVI fils?
> Is there any way to play MPEG, is that any better?
[quoted text clipped - 13 lines]
>>>> ("C:\Windows\demo.avi")
>>>> 'any suggestions
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.