Media player and WMA in VB6

Visual Basic

    Sponsored Links

    Next

  • 1. SuSE 10.1
    As a newbie I have a few questions about this 10.1 which is being discussed Mainly is it a major upgrade and should I upgrade or stick to 10.0 for the time being? Just getting the hang of V10 but having said that I do not have anything critical on the SuSE box and it can be wiped, re-installed clean if necessary so I am not too bothered about any upgrade going horribly wrong. I just hate installing OSs its boring although it is eduactional with Linux. Wotcha think? Jonah
  • 2. Location for new form
    Hello, I looking for place a FORM at specific position, I want double click on OBJ and i need to show a small form at this position to select parameters. Any help, i not found on API.... :-((( Thank's Steve Tremlay
  • 3. week no
    Hi all. I need to make a function to calculate the week nr for now, from date 19000101 a easy exmpl. the first week in 19000101 have week nr 0 and so on.....but which weeknr do we have now ? and gues we have use Datepart function in visual basic....but the syntax.. ? hope someone can help in this case ? :)
  • 4. selecting an optimum combination of parts.
    Hi there, I need to solve a problem and any practical assistance would be gratefully received. I have a variable matrix of parts and values (the number of parts and their values varies from situation to situtation) with a sample as follows: Parts Value 1 part costs 948 2 parts cost 1,134 3 parts cost 1,375 4 1,455 6 1,615 12 2,732 24 4,853 48 9,705 If I need 36 parts then my best order would be: 1 x 24 parts @ 4,853 1 x 12 parts @ 2,732 giving a total of 7,585 If I need 35 parts my order could be: 1 x 24 parts @ 4,853 1 x 6 parts @ 1,615 1 x 4 parts @ 1,455 1 x 1 part @ 948 giving a total of 8,871 For 35 parts I'd be better off ordering the 36 part combination. Does anyone have any pseudo code that solves this problem by always picking the optimum (cheapest combination) number of parts (even if some parts get wasted) I could write code that works out every possible combination and then spews out the cheapest combination *BUT* when I'm ordering 2,564 parts the calculation is going to take forever, especially as the matrix is variable. I'm sure there is a clever way to do this but don't know how. Thanks for your time. Kind regards, Craig Timms XXXX@XXXXX.COM
  • 5. VB6 Trying to Enumerate Sections in an INI file. GetPrivateProfileString(vbNull returns a 1.
    OK. I'm stumped. I have an INI file with the content : [Settings] Server=\\master\svrdata\ [55] Description=test ReportOrder=1 AddSubIgnore=+ [45] Description=test2 ReportOrder=2 AddSubIgnore=- Reading an enumerating keys I can do no problem - but enumerating sections has been ellusive. The following looks like it's supposed to work - but it returns just a plain "1". Public Function ReturnSections(iniFile) As String Dim sRet As String Dim BufferSize As Integer sRet = String(255, Chr(0)) ReturnSections = Left(sRet, GetPrivateProfileString(vbNull, vbNull, vbNull, sRet, Len(sRet), iniFile)) End Function Like I said - enumerating the keys is easy with : Public Function ReadINISection(AppName, iniFile) As String Dim sRet As String sRet = String(255, Chr(0)) ReadINISection = Left(sRet, GetPrivateProfileSection(AppName, sRet, Len(sRet), iniFile)) ' Everything is delimeted by a space End Function Any help would be GREATLY appreciated.

Media player and WMA in VB6

Postby JR » Wed, 26 Apr 2006 20:49:35 GMT

Hi,

A want to play a WMA file in VB6.
I have a mediaplayer control from then msdxm.ocx lib
I use this code


'start code
Private Sub cmdPlay_Click()
  Dim sBestand As String
  If File1.ListIndex > -1 Then
    sBestand = File1.path & IIf(Right(sBestand, 1) = "\", "", "\") & 
File1.FileName
    With MediaPlayer1
      .FileName = sBestand
      If .FileName = "" Then
        Debug.Print sBestand
        MsgBox .ErrorCode & ": " & .ErrorDescription
      End If
    End With
  End If
End Sub
'end code

it works fine with mp3 and wav but I always get the errorcode : -2147467259 
and the discription  can't open check filename and try again
the discription is translated and can be someting like this.

some an idee 



Re: Media player and WMA in VB6

Postby Henning » Wed, 26 Apr 2006 21:44:17 GMT

"JR" < XXXX@XXXXX.COM > skrev i meddelandet



What is the following line supposed to do?
/Henning

: -2147467259



Re: Media player and WMA in VB6

Postby JR » Thu, 27 Apr 2006 06:58:09 GMT

Sorry
that must be

sBestand = File1.path & IIf(Right(File1.path, 1) = "\", "", "\") & 
File1.FileName

i Also get the error -2147221164 (class not registerd)

Jan
"Henning" < XXXX@XXXXX.COM > schreef in bericht 






Re: Media player and WMA in VB6

Postby Henning » Thu, 27 Apr 2006 07:13:27 GMT

What if you change it to this?
 File1.FileName
     With MediaPlayer1
       If sBestand = "" Then
         Debug.Print sBestand
         MsgBox .ErrorCode & ": " & .ErrorDescription
       Else
       .FileName = sBestand
       End If
     End With
/Henning

"JR" < XXXX@XXXXX.COM > skrev i meddelandet







Re: Media player and WMA in VB6

Postby Henning » Thu, 27 Apr 2006 07:26:11 GMT

Also try:
MsgBox .ErrorNumber & ": " & .ErrorMessage
/Henning

"Henning" < XXXX@XXXXX.COM > skrev i meddelandet








Re: Media player and WMA in VB6

Postby JR » Thu, 27 Apr 2006 18:31:20 GMT

hi,

ErrorNumber &  ErrorMessage are not recognised
Remember it works fine for mp3 and wav

Jan


"Henning" < XXXX@XXXXX.COM > schreef in bericht 









Re: Media player and WMA in VB6

Postby JR » Fri, 28 Apr 2006 08:56:21 GMT

ore testing brengs me to the following

opening a wma in the formload has no problem

after running the code: Set oWMP = New WindowsMediaPlayer
I can't play any wma anymore
the windowsmediaplayer came from the reference wmp.dll
I use the wmp to read the wma tag info. So if i can read the taginfo with
another method the problem is solfed to

Jan


"JR" < XXXX@XXXXX.COM > schreef in bericht
news:I5H3g.392493$ XXXX@XXXXX.COM ...



Re: Media player and WMA in VB6

Postby Henning » Fri, 28 Apr 2006 09:07:42 GMT

'm sorry to say I have no more ideas. You might get some hints from this
link.
http://www.a1vbcode.com/code.asp?type=multimedia&intPage=3

/Henning

"JR" < XXXX@XXXXX.COM > skrev i meddelandet
news:FMT3g.393574$ XXXX@XXXXX.COM ...
"\")



Re: Media player and WMA in VB6

Postby Henning » Fri, 28 Apr 2006 10:17:56 GMT

ust curious :)
I put mediaplayer from msdxm.ocx and placed a button on a form and voila it
plays ok.
Private Sub Command1_Click()
MediaPlayer1.FileName = "C:\30 Hank Marvin - Nights In White Satin.wma"
End Sub

Is your .wma file playing in windows mediaplayer?
Is your .wma file copyrighted?

/Henning

"JR" < XXXX@XXXXX.COM > skrev i meddelandet
news:FMT3g.393574$ XXXX@XXXXX.COM ...
"\")



Re: Media player and WMA in VB6

Postby JR » Fri, 28 Apr 2006 16:28:23 GMT

es on both
that code works fine
It plays in wmp
and no no protection

it goes wrong after running the code: Set oWMP = New WindowsMediaPlayer
(wmp.dll)
i have tryed some code like your example in the formload and no problems,
but like i wrote after the needed code for reading the wma tags its no
longer possible to play wma but mp3 has no errors

Jan


"Henning" < XXXX@XXXXX.COM > schreef in bericht
news:44501ead$0$6626$ XXXX@XXXXX.COM ...



Similar Threads:

1.I need code select soundcard media player in vb6

As I do to select the audio out with the windows measured player in the 
visual basic 6?! Please send me code for example.
Thanks!...

2.windows media player component in VB6

3.Handle to Windows Media Player 9.0 in VB6.0

How can I get a handle to a running instance of wmplayer.exe in VB6.0?
Should be something with GetObject(???)?

For instance I would like to programmatically be able to play the next song
without starting a new instance of WMP9.0.

4.Media Player in VB6

I am having a tough time with this control - WindowsMediaPlayer.

I can't get the control to be enabled in my app to use the
stop/play... . The only way it works now is it brings up the full
windows media player on to of the app. How do I get the control to
work inside my app without bringing up the media player window?

Thanks



Return to Visual Basic

 

Who is online

Users browsing this forum: No registered users and 46 guest