MCI not playing certain files
Hi,
Im trying to create a Media Player in .NET, I use this code to open a file:
mciSendString("open " & filename & " alias music", 0, 0, 0)
and I get the filename with:
filename = Chr(34) & tbxFilename.Text & Chr(34)
But if I try to play a file with a ! or a ' in the name, it says there was a problem while initializing MCI.
Is there a way I can play these files or do I have to rename them?
Thx, Don
Re: MCI not playing certain files
I'm not certain exactly how that'd be fixed, but there's a chance that one of the two standard escaping methods will work: \[CHAR] or %(HEX VALUE). E.g: %20 = ' ', "\"Hello" = "Hello
Also, If you're interested, I did a lot of work on a similar project a couple of years ago - PM me if you to have some of the source code.
Re: MCI not playing certain files
Hmm, I can't get it to work by %21 or \! :(
Hmm, it seems it just can't play certain songs, I found a song with a ' in it and worked...
Re: MCI not playing certain files
Either 1) Rename the file, or 2) Copy the file somewhere with a NEW name, and open that file.
Re: MCI not playing certain files
I tried renaming the file manually and then playing it, but this doesn't solve the problem. I just found out it has nothing to do with the filename...
Re: MCI not playing certain files
What format is the file in? Does it have some form of DRM protection?
Re: MCI not playing certain files
Quote:
Originally Posted by
Don Sandros
...
try
Code:
try
filename = """" & tbxFilename.Text & """"
mciSendString("open " & filename & " alias music", 0, 0, 0)
catch ex as exception
msgbox (ex.message)
end try
and tell what was the message error. It should give a clue on why it fails.
Re: MCI not playing certain files
Quote:
Originally Posted by
javajawa
What format is the file in? Does it have some form of DRM protection?
Thx, after saving the file again it worked :D So I think they were DRM protected
(Is it possible to remove DRM with some kind of quick tool? Saving all my mp3's again will take lots of time and will reduce the quality of the sound...)
Re: MCI not playing certain files
Legally, no. And We're all bound by the AUP here...