🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.basic.visual
Article #235

Re: MP3-player in VB6-program

#235
From: 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
Technical Details
Message-ID: <3eef886f.18258106@news-vip.optusnet.com.au>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news1.optus.net.au!optus!spool01.syd.optusnet.com.au!spool.optusnet.com.au!not-for-mail
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>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f51ba,d99d5ea1f5d104b8
X-Google-Attributes: gidf51ba,public
X-Google-Thread: 110e3b,d99d5ea1f5d104b8
X-Google-Attributes: gid110e3b,public
X-Google-Thread: f645d,d99d5ea1f5d104b8
X-Google-Attributes: gidf645d,public
X-Google-ArrivalTime: 2003-06-17 14:35:13 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news1.optus.net.au!optus!spool01.syd.optusnet.com.au!spool.optusnet.com.au!not-for-mail
From: fajp@xxxxoptushome.com.au (Frank Adam)
Newsgroups: comp.lang.basic.visual,comp.lang.basic.visual.misc,dk.edb.programmering.basic.visual-basic
Subject: Re: MP3-player in VB6-program
Date: Tue, 17 Jun 2003 21:34:08 GMT
Message-ID: <3eef886f.18258106@news-vip.optusnet.com.au>
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>
X-Newsreader: Forte Free Agent 1.21/32.243
Lines: 82
NNTP-Posting-Host: 210.49.249.154
X-Trace: 1055885570  13747 210.49.249.154