Visual basic MIDI file

Questions about programming languages and debugging
Post Reply
User avatar
ayu
Staff
Staff
Posts: 8077
Joined: 27 Aug 2005, 16:00
15
Contact:

Visual basic MIDI file

Post by ayu »

Hi there, i have used a MIDI file in a OLE object in my Visual Basic project. now i want the file to play automaticly when i start the program. how do i do this? : /

User avatar
CommonStray
Forum Assassin
Forum Assassin
Posts: 1214
Joined: 20 Aug 2005, 16:00
15

Post by CommonStray »

Code: Select all

Private Sub Form_Load()

OLE1.Action = 7

End Sub

User avatar
CommonStray
Forum Assassin
Forum Assassin
Posts: 1214
Joined: 20 Aug 2005, 16:00
15

Post by CommonStray »

ok i first tested it with a .wav and it worked, and now i just tested it with an .mp3 and it seems to work as well ;) hope this works mate ;)

its telling your form that onload() play your OLE Object

also it repeats ;)

User avatar
ayu
Staff
Staff
Posts: 8077
Joined: 27 Aug 2005, 16:00
15
Contact:

Post by ayu »

thx ^^ ...but now i got a new problem...when i start my program it asks for the MIDI file....cant i like...embed it to the program...as in it will get "built in" when i compile it.... it also just starts the media player...and when i turn of the program it still playes the song... : /

User avatar
CommonStray
Forum Assassin
Forum Assassin
Posts: 1214
Joined: 20 Aug 2005, 16:00
15

Post by CommonStray »

thats your OLE object doing its job, it references a media player to play the file for you instead of the program,, here when i get back ill hook you up with some code so you can embed the file into the program and it will play when you run the program, it wont use OLE ;)

User avatar
ayu
Staff
Staff
Posts: 8077
Joined: 27 Aug 2005, 16:00
15
Contact:

Post by ayu »

wiiie! ^^

User avatar
ayu
Staff
Staff
Posts: 8077
Joined: 27 Aug 2005, 16:00
15
Contact:

Post by ayu »

any progress? =P

User avatar
CommonStray
Forum Assassin
Forum Assassin
Posts: 1214
Joined: 20 Aug 2005, 16:00
15

Post by CommonStray »

here

http://builder.com.com/5100-6228-5430873.html

this shows you how to implement sounds for user interaction, just remember you want it to play when your application starts so some initialization coding will be in

Private Sub Form_Load()

to achieve it ;) hope this helps letme know how it goes

Post Reply