🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.basic.visual
9 messages
9 total messages Started by sjoerd Tue, 17 Jun 2003 13:22
MP3-player in VB6-program
#228
Author: sjoerd
Date: Tue, 17 Jun 2003 13:22
12 lines
1549 bytes
Hi,

I wrote a program in VB6 to organize and play mp3-files. At this moment I
use a shellcommand to play the mp3-files. (shell c:\program
files\winamp3\winamp3.exe <filename>)

It works, but it isn't the most beautiful way. Can I male a player part of
my VB-program to play the files?

Thanks,

Sjoerd
Re: MP3-player in VB6-program
#229
Author: Ian Cowley
Date: Tue, 17 Jun 2003 13:25
17 lines
1702 bytes
sjoerd <iwi@iwi.myweb.nl> burbled:
> Hi,
>
> I wrote a program in VB6 to organize and play mp3-files. At this
> moment I use a shellcommand to play the mp3-files. (shell c:\program
> files\winamp3\winamp3.exe <filename>)
>
> It works, but it isn't the most beautiful way. Can I male a player
> part of my VB-program to play the files?

DirectPlay should be able to play MP3s.  Try implementing the DP APIs.

-- 
Ian Cowley (Not Reverend)  - Perfecting pedantry through practice

"It was quite a funny joke, and nobody got hurt. The ones where
 nothing catches on fire are my favourite."
Re: MP3-player in VB6-program
#232
Author: BeastFish
Date: Tue, 17 Jun 2003 21:12
21 lines
1606 bytes
you can use MCI.  Take a look at this site:

http://www.geocities.com/smigman.geo/mci/mci.html





"sjoerd" <iwi@iwi.myweb.nl> wrote in message news:<bcn4n0$u2n$1@news3.tilbu1.nb.home.nl>...
> Hi,
> 
> I wrote a program in VB6 to organize and play mp3-files. At this moment I
> use a shellcommand to play the mp3-files. (shell c:\program
> files\winamp3\winamp3.exe <filename>)
> 
> It works, but it isn't the most beautiful way. Can I male a player part of
> my VB-program to play the files?
> 
> Thanks,
> 
> Sjoerd
Re: MP3-player in VB6-program
#233
Author: Mike Williams
Date: Tue, 17 Jun 2003 21:17
9 lines
1681 bytes
"BeastFish" <BeastFish@for-president.com> wrote in message
news:e200086.0306171312.4def7f05@posting.google.com...
> you can use MCI.  Take a look at this site:
> http://www.geocities.com/smigman.geo/mci/mci.html

Are you sure that thing (MCI) can play mp3 files. I certainly can't make it
do so.

Mike
Re: MP3-player in VB6-program
#234
Author: Frank Adam
Date: Tue, 17 Jun 2003 21:28
27 lines
1872 bytes
On Tue, 17 Jun 2003 22:17:54 +0100, "Mike Williams"
<Mike@BrandyandCoke.fsnet.co.uk> wrote:

>"BeastFish" <BeastFish@for-president.com> wrote in message
>news:e200086.0306171312.4def7f05@posting.google.com...
>> you can use MCI.  Take a look at this site:
>> http://www.geocities.com/smigman.geo/mci/mci.html
>
>Are you sure that thing (MCI) can play mp3 files. I certainly can't make it
>do so.
>
I can. :-p

excerpt :

Public Function MCIPlay() As Long
    Dim sRet As String * 200
    Dim ret As Long
    ret = mciSendString("play playing", sRet, 200, 0)
    If ret = 0 Then
        frmPlayer.tmrMCIUpdate.Enabled = True
    End If
End Function

-- 

Regards, Frank
Re: MP3-player in VB6-program
#235
Author: Frank Adam
Date: Tue, 17 Jun 2003 21:34
82 lines
3385 bytes
On Tue, 17 Jun 2003 21:28:52 GMT, fajp@xxxxoptushome.com.au (Frank
Adam) wrote:

Actually this might come in handy with that. :)

Note : playmode is not used. I let the system work it all out.

Public Function PlayFile(fileName As String, playMode As PLAYMODES) As
Boolean
    Dim sRet As String
    Dim ret As Long, secs As Long, mins As Long, sec As Long
    sRet = Space$(200)
    
    isFilePlaying = False

START_PLAY:
            
    ret = mciSendString("open " & Chr$(34) & Trim$(fileName) &
Chr$(34) & " alias playing", sRet, Len(sRet), 0)
    If ret Then
        Select Case ret
            Case MCIERR_DUPLICATE_ALIAS:
                Call CloseMCI
                GoTo START_PLAY
            Case Else:
                MsgBox ret, vbOKOnly, "MCIError"
        End Select
    End If
    If ret = 0 Then
        ret = mciSendString("set playing time format ms", sRet, 200,
0)
        ret = mciSendString("status playing length", sRet, 200, 0)
        If ret = 0 Then
            secs = Val(Trim$(sRet)) \ 1000
            sec = secs Mod 60
            mins = secs \ 60
            frmPlayer.uscProgressBar1.Value = 0
            frmPlayer.uscProgressBar1.Max = secs
            curFileLength = "/" & Format$(mins, "00") & ":" &
Format$(sec, "00")
            
            Else
                curFileLength = "/??:??"
        End If
        isMCIOpen = True
        isFilePlaying = MCIPlay
    End If
    PlayFile = isFilePlaying
End Function


>On Tue, 17 Jun 2003 22:17:54 +0100, "Mike Williams"
><Mike@BrandyandCoke.fsnet.co.uk> wrote:
>
>>"BeastFish" <BeastFish@for-president.com> wrote in message
>>news:e200086.0306171312.4def7f05@posting.google.com...
>>> you can use MCI.  Take a look at this site:
>>> http://www.geocities.com/smigman.geo/mci/mci.html
>>
>>Are you sure that thing (MCI) can play mp3 files. I certainly can't make it
>>do so.
>>
>I can. :-p
>
>excerpt :
>
>Public Function MCIPlay() As Long
>    Dim sRet As String * 200
>    Dim ret As Long
>    ret = mciSendString("play playing", sRet, 200, 0)
>    If ret = 0 Then
>        frmPlayer.tmrMCIUpdate.Enabled = True
>    End If
>End Function
>
>-- 
>
>Regards, Frank

-- 

Regards, Frank
Re: MP3-player in VB6-program
#236
Author: Larry
Date: Wed, 18 Jun 2003 00:44
24 lines
2517 bytes
"Mike Williams" <Mike@BrandyandCoke.fsnet.co.uk> wrote in message
news:bco0ju$2u0$1@newsg3.svr.pol.co.uk...
> "BeastFish" <BeastFish@for-president.com> wrote in message
> news:e200086.0306171312.4def7f05@posting.google.com...
> > you can use MCI.  Take a look at this site:
> > http://www.geocities.com/smigman.geo/mci/mci.html
>
> Are you sure that thing (MCI) can play mp3 files. I certainly can't make
it
> do so.
>
> Mike
>
Are you specifying the correct device type in the call to mciSendString to
"open" ? Have you tried MPEGVideo2 ?

e.g. mciSendString "open " & chr(34) & MyMP3 & chr(34) & _
      " type MPEGVideo2 alias MP3",0&, 0, hWnd

If that doesn't work, take a look in your win.ini (in the windows directory)
under MCI and see what is associated with MP3

HTH
Re: MP3-player in VB6-program
#237
Author: BeastFish
Date: Wed, 18 Jun 2003 05:35
18 lines
1747 bytes
Yup.  But MCI barfs on long filenames, especially if there are spaces.
 So ya need to get the DOS short path/file name (GetShortPathName
API).





"Mike Williams" <Mike@BrandyandCoke.fsnet.co.uk> wrote in message news:<bco0ju$2u0$1@newsg3.svr.pol.co.uk>...
> "BeastFish" <BeastFish@for-president.com> wrote in message
> news:e200086.0306171312.4def7f05@posting.google.com...
> > you can use MCI.  Take a look at this site:
> > http://www.geocities.com/smigman.geo/mci/mci.html
> 
> Are you sure that thing (MCI) can play mp3 files. I certainly can't make it
> do so.
> 
> Mike
Re: MP3-player in VB6-program
#239
Author: Mike Williams
Date: Wed, 18 Jun 2003 10:04
90 lines
4056 bytes
Thank you Frank and Larry and Beatie Boy. Got it going now :-)

Mike


"Frank Adam" <fajp@xxxxoptushome.com.au> wrote in message
news:3eef886f.18258106@news-vip.optusnet.com.au...
> On Tue, 17 Jun 2003 21:28:52 GMT, fajp@xxxxoptushome.com.au (Frank
> Adam) wrote:
>
> Actually this might come in handy with that. :)
>
> Note : playmode is not used. I let the system work it all out.
>
> Public Function PlayFile(fileName As String, playMode As PLAYMODES) As
> Boolean
>     Dim sRet As String
>     Dim ret As Long, secs As Long, mins As Long, sec As Long
>     sRet = Space$(200)
>
>     isFilePlaying = False
>
> START_PLAY:
>
>     ret = mciSendString("open " & Chr$(34) & Trim$(fileName) &
> Chr$(34) & " alias playing", sRet, Len(sRet), 0)
>     If ret Then
>         Select Case ret
>             Case MCIERR_DUPLICATE_ALIAS:
>                 Call CloseMCI
>                 GoTo START_PLAY
>             Case Else:
>                 MsgBox ret, vbOKOnly, "MCIError"
>         End Select
>     End If
>     If ret = 0 Then
>         ret = mciSendString("set playing time format ms", sRet, 200,
> 0)
>         ret = mciSendString("status playing length", sRet, 200, 0)
>         If ret = 0 Then
>             secs = Val(Trim$(sRet)) \ 1000
>             sec = secs Mod 60
>             mins = secs \ 60
>             frmPlayer.uscProgressBar1.Value = 0
>             frmPlayer.uscProgressBar1.Max = secs
>             curFileLength = "/" & Format$(mins, "00") & ":" &
> Format$(sec, "00")
>
>             Else
>                 curFileLength = "/??:??"
>         End If
>         isMCIOpen = True
>         isFilePlaying = MCIPlay
>     End If
>     PlayFile = isFilePlaying
> End Function
>
>
> >On Tue, 17 Jun 2003 22:17:54 +0100, "Mike Williams"
> ><Mike@BrandyandCoke.fsnet.co.uk> wrote:
> >
> >>"BeastFish" <BeastFish@for-president.com> wrote in message
> >>news:e200086.0306171312.4def7f05@posting.google.com...
> >>> you can use MCI.  Take a look at this site:
> >>> http://www.geocities.com/smigman.geo/mci/mci.html
> >>
> >>Are you sure that thing (MCI) can play mp3 files. I certainly can't make
it
> >>do so.
> >>
> >I can. :-p
> >
> >excerpt :
> >
> >Public Function MCIPlay() As Long
> >    Dim sRet As String * 200
> >    Dim ret As Long
> >    ret = mciSendString("play playing", sRet, 200, 0)
> >    If ret = 0 Then
> >        frmPlayer.tmrMCIUpdate.Enabled = True
> >    End If
> >End Function
> >
> >--
> >
> >Regards, Frank
>
> --
>
> Regards, Frank
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads