borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (embedding Windows Media Player in VB program)Next Topic (DVD2AVI? No problem!) New Topic New Poll Post Reply
AndreaVB Forum : Multimedia : running .AVI file from VB
Poster Message
Pran K Saha
Level: Guest


icon running .AVI file from VB

I wand to run .avi file from VB6. Does is possible. If possible can u please send me the process how to do it and the code also.

Thanx in advance

30-01-2003 at 11:21 AM
| Quote Reply
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876
icon Re: running .AVI file from VB

Pran K Saha, WELCOME TO THE FORUM!!!
  

yes, its possible.

first, add the component Windows Media Player to the toolbox, then create an instance of it on the form.

this is the code to play an avi file...

MediaPlayer1.FileName = "c:windowsdesktopMy.avi"
'just a sample filename... of course change
'this to the location of the file you want to
'play, okay?

'then to play
MediaPlayer1.Play


simple, huh? if you have other questions, post back, okay?

also, you can play .wav, .mp3 and other stuff.
just check the formats tab on the options menu under view of the windows media player exe.

[Edited by vbgen on 31-01-2003 at 12:59 AM GMT]

____________________________
Been busy trying to take a second degree <--it's not working out...

30-01-2003 at 04:58 PM
View Profile Send Email to User Show All Posts | Quote Reply
andrea_deleon
Level: Guest

icon Re: running .AVI file from VB

I also tried running .AVI file. But my Windows Media Player itself doesn't run .AVI file. What's wrong with it? It gives an error message about codecs, I don't know. Any idea? help?

19-05-2003 at 09:39 PM
| Quote Reply
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876
icon Re: running .AVI file from VB

what is the ocx you are using? is it updated with your version of media player?

post the error... that myt help... as well as the code, if you don't mind.  

____________________________
Been busy trying to take a second degree <--it's not working out...

20-05-2003 at 06:21 PM
View Profile Send Email to User Show All Posts | Quote Reply
sajoo
Level: Big Cheese

Registered: 17-05-2003
Posts: 22
icon Re: running .AVI file from VB

Sir i do your coding but i can't work
what's wrong with
remmamber i am using windows me.



____________________________
sajoo

21-05-2003 at 05:11 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876
icon Re: running .AVI file from VB

hello, sajoo...

tell me, have you changed the address of the avi file you are trying to play?

also, i have no experience with me, but i don't know either if that affects the code.  

if you used the exact code, then i would like to ask again for the error msg that you get when you attempt to run the code.

thank you sajoo, i will wait for your post.  


----------------------------------------
and, don't call me sir.... (tho i appreciate the respectful approach! )

i am barely 23.. i guess you could call me vbgen.    

____________________________
Been busy trying to take a second degree <--it's not working out...

21-05-2003 at 06:45 AM
View Profile Send Email to User Show All Posts | Quote Reply
sajoo
Level: Big Cheese

Registered: 17-05-2003
Posts: 22
icon Re: running .AVI file from VB

HI SIR VBGEN

I CODE THE EXECT CODING YOU WRITE

I ALSO CHAGE THE FILE NAME THAT WAS ON THE D:
DRIVE OF MY PC

AS FOR AS I THINK THE ERROR WAS"OUTSIDE PROCEDURE ERROR"

HELP ME

THANKX
SAJOO  

____________________________
sajoo

21-05-2003 at 02:52 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876
icon Re: running .AVI file from VB

well.. you should use the correct control or component to have this work... it should be windows media player... or something like that.

hope you get to fix this soon.  

____________________________
Been busy trying to take a second degree <--it's not working out...

23-05-2003 at 03:47 PM
View Profile Send Email to User Show All Posts | Quote Reply
andrea_deleon
Level: Guest

icon Re: running .AVI file from VB

I made a program that generates WAV sounds using the Microsoft Multimedia Control 6.0 component. My problem: My program has to wait for a wav sound to complete before it proceeds to next tasks like detecting mouse clicks and keyboard entries. Say, if the wav sound takes 10 seconds, my program doesn't respond to any mouse clicks and keyboard presses for 10 seconds too. It has to wait for the sound to complete, eventually processing all those buffered key entries . Please advice on how I could make my program accept keyboard inputs and mouse controls while the music is going on. I tried using DoEvents but it didn't work. My codes look like this...

MMControl1.FileName = App.Path & "VOICESINTRO.WAV"
MMControl1.DeviceType = "WavAudio"
MMControl1.Command = "OPEN" ' play sound now
DoEvents

If INTRO.WAV is 10 seconds long, when the sound starts, my mouse clicks and keypresses and other form actions are not accepted for 10 seconds too. Even a Timer control doesn't work. Please help. Thanks.

24-05-2003 at 05:20 PM
| Quote Reply
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876
icon Re: running .AVI file from VB

well, you can start by playing around with the position of the DoEvents command..

sometimes, (believe me), it's a bit tricky with the position or with the sequence of commands.

another thing maybe that you could do this:

MMControl1.FileName = App.Path & "VOICESINTRO.WAV"
MMControl1.DeviceType = "WavAudio"
MMControl1.Command = "OPEN" ' play sound now


inside another function, then call that function and then DoEvents.


  sorry... i'm busy rught now, so ican't come up with better ideas.. everything's coming of the tiny leaky hole on my head.  

____________________________
Been busy trying to take a second degree <--it's not working out...

29-05-2003 at 06:09 PM
View Profile Send Email to User Show All Posts | Quote Reply
andrea_deleon
Level: Guest

icon Re: running .AVI file from VB

Regarding playing the WavAudio file problem...
I did made it a function, then I just called the function, and call DoEvents. Still, it didn't work. I tried to place DoEvents before and after the function call, even inside the code of the function, still it didn't work. Any help please. Thanks.

24-06-2003 at 06:33 PM
| Quote Reply
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876
icon Re: running .AVI file from VB

off the top of my head....  

i guess you could try creating another form with the mediaplayer in it, and then load the form and play the file when you want to, then inside the form, whether it's visible or not, after the code to play the file, place 'unload me' on the next line...

try it, and post back  

____________________________
Been busy trying to take a second degree <--it's not working out...

24-06-2003 at 06:45 PM
View Profile Send Email to User Show All Posts | Quote Reply
blackmamba9
Level: Trainee

Registered: 20-01-2005
Posts: 1
icon Re: running .AVI file from VB

quote:
vbgen wrote:
Pran K Saha, WELCOME TO THE FORUM!!!
  

yes, its possible.

first, add the component Windows Media Player to the toolbox, then create an instance of it on the form.

this is the code to play an avi file...

MediaPlayer1.FileName = "c:windowsdesktopMy.avi"
'just a sample filename... of course change
'this to the location of the file you want to
'play, okay?

'then to play
MediaPlayer1.Play


simple, huh? if you have other questions, post back, okay?

also, you can play .wav, .mp3 and other stuff.
just check the formats tab on the options menu under view of the windows media player exe.

[Edited by vbgen on 31-01-2003 at 12:59 AM GMT]



Hi, i was just wonder how do i add the Windows Media Player to the toolbox?  Im using vb.net and i did try to add the WMP but instead of it showing WindowsPlayer1, it shows AxWindowsMediaPlayer1 instead.  I also tried the .FileName = "C: ..." but it doesnt have the .FileName method.
Maybe i added the WMP to toolbox the wrong way?
20-01-2005 at 10:23 PM
View Profile Send Email to User Show All Posts | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: running .AVI file from VB

check this

____________________________
If you find the answer helpful, please mark this topic as solved.

21-01-2005 at 12:25 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Multimedia : running .AVI file from VB
Previous Topic (embedding Windows Media Player in VB program)Next Topic (DVD2AVI? No problem!) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder