Page 2 of 3

Posted: Tue May 30, 2006 10:04 pm
by Joakim Christiansen
That's just insane! :?
And all your other media players works fine?

Anyone else having this problem?

Posted: Tue May 30, 2006 10:09 pm
by rsts
Normally just use winamp and it works fine, but have used others with no problems.

If you would like to send a code snippet or whatever I can attempt to determine what's happening, but it just goes away.

cheers

Posted: Tue May 30, 2006 10:42 pm
by Joakim Christiansen
rsts wrote:If you would like to send a code snippet or whatever I can attempt to determine what's happening, but it just goes away.
Hmm, i'm not shure exactly what it could be!
But you could start trying this snippet:

Code: Select all

Define Tag.s{3}, Title.s{30}, Length.s{128}, File.s = OpenFileRequester("Open","","All files (*.*)|*.*",0)
If File
  If mciSendString_("OPEN "+#DQUOTE$+File+#DQUOTE$+" TYPE MPEGVIDEO ALIAS Temp",0,0,0)=0
    
    mciSendString_("STATUS Temp LENGTH",@Length,128,0)
    mciSendString_("CLOSE Temp",0,0,0)
  
    Debug "Filename: " + Left(GetFilePart(File),Len(GetFilePart(File))-4)
    Debug "Length (seconds): " + Str(Val(Length)/1000)
    
    If ReadFile(0,File)
      FileSeek(0,Lof(0)-128)
      ReadData(0,@Tag,3)
      If Tag = "TAG"
        ReadData(0,@Title,30)
        Debug "Title: " + Title
      EndIf
      CloseFile(0)
    EndIf
    
  EndIf
EndIf

Posted: Wed May 31, 2006 12:04 am
by rsts
If mciSendString_("OPEN "+#DQUOTE$+File+#DQUOTE$+" TYPE MPEGVIDEO ALIAS Temp",0,0,0)=0

Invalid memory access.

cheers

File is "V:\MP3\03-sparetime-vschmid.mp3"
other variables are null

Posted: Wed May 31, 2006 12:11 am
by Flype
hello,

and if you try to remove the fixed strings {3}, {30}, ... ?

and does it works with file = "c:\test.mp3 ?"

Posted: Wed May 31, 2006 12:17 am
by rsts
Flype wrote:hello,

and if you try to remove the fixed strings {3}, {30}, ... ?

and does it works with file = "c:\test.mp3 ?"
not quite sure I understand what you mean by removing the fixed strings, but if I attempt to open c:\test.mp3, I get the same memory error as before.

cheers

Posted: Wed May 31, 2006 12:20 am
by Flype

Code: Select all

Define Tag.s{3}, Title.s{30}, Length.s{128}, File.s = OpenFileRequester("Open","","All files (*.*)|*.*",0)
If File
  If mciSendString_("OPEN "+#DQUOTE$+File+#DQUOTE$+" TYPE MPEGVIDEO ALIAS Temp",0,0,0)=0
    
    mciSendString_("STATUS Temp LENGTH",@Length,128,0)
    mciSendString_("CLOSE Temp",0,0,0)
  
    Debug "Filename: " + Left(GetFilePart(File),Len(GetFilePart(File))-4)
    Debug "Length (seconds): " + Str(Val(Length)/1000)
    
    If ReadFile(0,File)
      FileSeek(0,Lof(0)-128)
      ReadData(0,@Tag,3)
      If Tag = "TAG"
        ReadData(0,@Title,30)
        Debug "Title: " + Title
      EndIf
      CloseFile(0)
    EndIf
    
  EndIf
EndIf
i mean on the first line of this source code
and using space() instead of {}... maybe who knows :)

Posted: Wed May 31, 2006 12:36 am
by rsts
Flype wrote: i mean on the first line of this source code
and using space() instead of {}... maybe who knows :)
I thought that might be what you meant, but anything except a number gives me a syntax error.

cheers

Posted: Wed May 31, 2006 12:44 am
by Joakim Christiansen
Convert Title.s{30} to Title.s = Space(30)
And so on, and try again!

Looks like we found a PB bug?

Posted: Wed May 31, 2006 1:04 am
by rsts
Define Tag.s = Space(3), Title.s = Space(30), length.s{128}, File.s = OpenFileRequester("Open","","All files (*.*)|*.*",0)

give me the same memory access error

Was that what you meant?

cheers

Posted: Wed May 31, 2006 1:07 am
by Joakim Christiansen
Yes, that's what I meant.
Maybe you have a problem with fixed strings, so try on length also!
If so then it's a PureBasic bug and then I know how to fix my source!

Posted: Wed May 31, 2006 1:52 am
by rsts
Define Tag.s = Space(3), Title.s = Space(30), length.s = Space(128), File.s = OpenFileRequester("Open","","All files (*.*)|*.*",0)
If File
If mciSendString_("OPEN "+#DQUOTE$+File+#DQUOTE$+" TYPE MPEGVIDEO ALIAS Temp",0,0,0)=0


yields same memory access error on the mciSendString statement.

cheers

Posted: Wed May 31, 2006 1:56 am
by Joakim Christiansen
rsts, then I guess you have to report this as a PB bug?

Posted: Wed May 31, 2006 2:38 am
by rsts
Well, if I'm the only one who experiences any problem, I'll chalk it up to some idiosyncrasy of my system rather than a PB bug:)

cheers

Posted: Wed May 31, 2006 8:50 am
by inc.
Try to do the approach for finding the error in code part steps, means do a test without the TAG parser.

Code: Select all

Define Tag.s{3}, Title.s{30}, Length.s{128}, File.s = OpenFileRequester("Open","","All files (*.*)|*.*",0)
If File
  If mciSendString_("OPEN "+#DQUOTE$+File+#DQUOTE$+" TYPE MPEGVIDEO ALIAS Temp",0,0,0)=0
   
    mciSendString_("STATUS Temp LENGTH",@Length,128,0)
    mciSendString_("CLOSE Temp",0,0,0)
 
    Debug "Filename: " + Left(GetFilePart(File),Len(GetFilePart(File))-4)
    Debug "Length (seconds): " + Str(Val(Length)/1000)
   
  EndIf
EndIf
also ...

- .... maybe an unicode issue?

- MCI procedures do best work with short path names! ..

shortFilename.s = space(xxxx)
res = GetShortPathName_(@File, @shortFilename, xxxx).


- Also try if the Doublequote constant in here causes problems.
If mciSendString_("OPEN "+File+" TYPE MPEGVIDEO ALIAS Temp",0,0,0)=0

- is this a VBR mp3? mp3s always should be encoded as CBR for compatibility purposes. As this lets often the specific installed mp3 decoder beeing messed up when trying to decode. (VBR = Varaible Bitrate, CBR = Constant bitrate).