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 (Just put Video in VB.Net)Next Topic (mmc control) New Topic New Poll Post Reply
AndreaVB Forum : Multimedia : sound???
Poster Message
third_person
Level: Protégé

Registered: 28-03-2006
Posts: 4

icon sound???

hi every buddy
    
i got a exe like this---

when u open it there have some midi music behinde it.
but there have no .midi file.

i wannna do something like this. MIDI musick in EXE.
is this possible??

                

____________________________
the sun goes down....i feel the light betray me

29-03-2006 at 07:03 AM
View Profile Send Email to User Show All Posts | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: sound???

Yes. You need to create a resource file in VB, in which you will store midi file to play. You will then use LoadResData function to extract midi from resource file and store it on the disk (usually in application folder), from where it will be played.

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

29-03-2006 at 11:26 PM
View Profile Send Email to User Show All Posts | Quote Reply
third_person
Level: Protégé

Registered: 28-03-2006
Posts: 4
icon Re: sound???

sorry boss

can u give me sample. i cannot understand that.

how to do this?

____________________________
the sun goes down....i feel the light betray me

30-03-2006 at 05:56 AM
View Profile Send Email to User Show All Posts | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: sound???

Just google for an article on resourc files and VB6

http://www.thevbzone.com/l_res.htm

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

30-03-2006 at 09:30 AM
View Profile Send Email to User Show All Posts | Quote Reply
third_person
Level: Protégé

Registered: 28-03-2006
Posts: 4
icon Re: sound???

my last question about it..


how could i loop the midi i mean nonstop play?

____________________________
the sun goes down....i feel the light betray me

03-04-2006 at 06:55 AM
View Profile Send Email to User Show All Posts | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: sound???

Use sndPlaySound with the SND_LOOP constant..

' declarations

Const SND_ASYNC = &H1
Const SND_NODEFAULT = &H2
Const SND_LOOP As Long = &H8

Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long


'  to start playing

sndPlaySound FileNameToPlay, SND_ASYNC Or SND_NODEFAULT Or SND_LOOP

' you need to stop playing. a good place should beform unload event

sndPlaySound vbNullString, 0&


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

03-04-2006 at 04:31 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Multimedia : sound???
Previous Topic (Just put Video in VB.Net)Next Topic (mmc control) 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