Article View: comp.lang.basic.visual
Article #239Re: MP3-player in VB6-program
From: Mike Williams
Date: Wed, 18 Jun 2003 10:04
Date: Wed, 18 Jun 2003 10:04
90 lines
4056 bytes
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
Technical Details
Message-ID:
<bcpdjf$skt$1@news6.svr.pol.co.uk>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newspeer.monmouth.com!colt.net!diablo.theplanet.net!news.theplanet.net!not-for-mailReferences:
<bcn4n0$u2n$1@news3.tilbu1.nb.home.nl> <e200086.0306171312.4def7f05@posting.google.com> <bco0ju$2u0$1@newsg3.svr.pol.co.uk> <3eef86dd.17856098@news-vip.optusnet.com.au> <3eef886f.18258106@news-vip.optusnet.com.au>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 110e3b,d99d5ea1f5d104b8 X-Google-Attributes: gid110e3b,public X-Google-Thread: f51ba,d99d5ea1f5d104b8 X-Google-Attributes: gidf51ba,public X-Google-Thread: f645d,d99d5ea1f5d104b8 X-Google-Attributes: gidf645d,public X-Google-ArrivalTime: 2003-06-18 03:06:40 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newspeer.monmouth.com!colt.net!diablo.theplanet.net!news.theplanet.net!not-for-mail From: "Mike Williams" <Mike@BrandyandCoke.fsnet.co.uk> Newsgroups: comp.lang.basic.visual,comp.lang.basic.visual.misc,dk.edb.programmering.basic.visual-basic Subject: Re: MP3-player in VB6-program Date: Wed, 18 Jun 2003 11:04:31 +0100 Lines: 91 Message-ID: <bcpdjf$skt$1@news6.svr.pol.co.uk> References: <bcn4n0$u2n$1@news3.tilbu1.nb.home.nl> <e200086.0306171312.4def7f05@posting.google.com> <bco0ju$2u0$1@newsg3.svr.pol.co.uk> <3eef86dd.17856098@news-vip.optusnet.com.au> <3eef886f.18258106@news-vip.optusnet.com.au> NNTP-Posting-Host: 62.137.119.168 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: news6.svr.pol.co.uk 1055930799 29341 62.137.119.168 (18 Jun 2003 10:06:39 GMT) NNTP-Posting-Date: 18 Jun 2003 10:06:39 GMT X-Complaints-To: abuse@theplanet.net X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000