What's new

VB tips

Teamz

J'aime tes seins
it's not complicated to add images :

Dim btnX As Button

imagelistname.ListImages.Add 1, "name", LoadPicture("image.bmp")

toolbar.ImageList = imagelistname

Set btnX = imagelistname.Buttons.Add(, "name", , tbrDefault, 1)
 

Eagle

aka Alshain
Moderator
Teamz said:
it's not complicated to add images :

Dim btnX As Button

imagelistname.ListImages.Add 1, "name", LoadPicture("image.bmp")

toolbar.ImageList = imagelistname

Set btnX = imagelistname.Buttons.Add(, "name", , tbrDefault, 1)

1. He wanted to do it at design time.
2. Add an image to that list after setting the list to the toolbar, you will get an error.
 
OP
G

GuestX

New member
i have found a lot tutorals about dinput & dsound & mp3,
i am trying to code a mp3 player :D
i have watched, its not advanced (or *.wav)
i dont like WinAMP much :D
 

Eagle

aka Alshain
Moderator
SculleatR said:
but with PictureBox´s or Images or Command button you can
make a toolbar, easier .

True, but it doesnt look as good as a tool bar and a tool bar is all done in one method while buttons have several click methods.
 

Doomulation

?????????????????????????
SculleatR said:
i have found a lot tutorals about dinput & dsound & mp3,
i am trying to code a mp3 player :D
i have watched, its not advanced (or *.wav)
i dont like WinAMP much :D
Lol, oh so you want? I've done one already, lol.
Can play mp3, wma, midi and wav.
 
OP
G

GuestX

New member
cool, can you give me some info ???
the tutorials have errors with the
Code:
Dim pMC As FilegraphManager
or similar
 

Cyberman

Moderator
Moderator
SculleatR you should probably start a new thread about your MP3 attempts.

I think you are missing a component, you must add the MP3 components to your application, they must be active X.

In reality you are making an MP3 player but not a decoder. Trust me all you are doing is using someones MP3 decoder to generate the audio (lol). MP3 is quite complex. It's actually MPEG 1 Layer 3 audio specification and it became popular because the company that owned the patents (mumble) wasn't collecting royalty fees for it so boom MP3 format became popular because people could make MP3 players and decoders without fear of reprisals. Unfortunately the company who owned the patents changed there minds because it became popular. It still has movement though I guess so I guess MP3 might be here to stay :) You will not see much source code for an MP3 decoder around because of this though. :cry:

Have fun!

Cyb
 
OP
G

GuestX

New member
there are a lot source codes of MP3, Avi ... players.
I have downloaded some mp3 player sources :)


ps. sry, i havn´t posted a new thread >_<
 

Doomulation

?????????????????????????
Technically, all you need to do to play an mp3 file (or wma for that matter), do this :p

Dll declaration:
PHP:
Public Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long

Play a file:
PHP:
mciSendString "play " & strFileToPlay & " from 0", 0&, 0&, 0&

To stop or pause, just switch "play" to "stop" or "pause" and remove " from 0".

...
 
OP
G

GuestX

New member
Doomulation said:
Technically, all you need to do to play an mp3 file (or wma for that matter), do this :p

Dll declaration:
PHP:
Public Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long

Play a file:
PHP:
mciSendString "play " & strFileToPlay & " from 0", 0&, 0&, 0&

To stop or pause, just switch "play" to "stop" or "pause" and remove " from 0".

...

THIS THREAD WON`T DIE, TOO :baaa:
 
OP
G

GuestX

New member
well .... planet-source-code.

Code:
Sub WAVStop()
    Call WAVPlay(" ")
End Sub


Sub WAVLoop(File)
    Dim SoundName As String
    SoundName$ = File
    wFlags% = SND_ASYNC Or SND_LOOP
    X = sndPlaySound(SoundName$, wFlags%)
End Sub


Sub WAVPlay(File)
    Dim SoundName As String
    SoundName$ = File
    wFlags% = SND_ASYNC Or SND_NODEFAULT
    X = sndPlaySound(SoundName$, wFlags%)
End Sub
there are alot more
 

Doomulation

?????????????????????????
That code above is crap. Trust me.
And DirectSound only supports wave-files, yes.
You'll have to use DirectMusic for midi-files. Mp3 & Wma files are not supported.
 

Top