Problem with some mp3 crashing

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with some mp3 crashing

josh
Hi

I have been trying to debug my little app that is crashing when playing some mp3, so I thought I would check that simpleplayer plays them, and this also crashes, also tested with filterplayer.

I get error runerror(5) when I click play

at line 413
InputIndex1 := uos_AddFromFile(PlayerIndex1, pchar(Edit4.Text), -1, samformat, -1);


If I use audacity and re-export the file, sometimes this will work and sometimes not.

Note all these files play fine on multiple players, media player, itunes, virtualdj etc etc

Any ideas?
Reply | Threaded
Open this post in threaded view
|

Re: Problem with some mp3 crashing

josh
Hi

Fixed it by adding this into uos.pas

addfromfile

AssignFile(F, Filename);
FileMode:=fmOpenRead + fmShareDenyNone;  <-- added in

There is another assignfile in updatetag something
But I have not checked the code to see if it needs the same or different file permissions; ie does it change the file header to add tags; I have not checked yet; but you probably will know straigh away.

Now on to testing Equalizer? SOme questions first.
When I assign a new song to a PlayerIndex0 it says it overwrites everything, does that include the EQ Filters etc, so I would have to create the EQ Bands each time a new song is played on playerindex0?

additional if I add custom options Debug, I have several compile errors when targeting win 32
plugin create

{$if defined(cpu64)}
    PlugHandle:= 0;
    {$else}
    PlugHandle:= -1;  <-- out of range from type is positive value
    {$ENDIF}      

also a couple of these
{$IF DEFINED(debug)}
  writeln('After Filetobuffer');
  writeln('length(tempoutmemory) =' +inttostr(length(tempoutmemory)));
  st := '';
  for i := 0 to length(outmemory) -1 do
  st := st + '|' + inttostr(i) + '=' + floattostr(tempoutmemory[i]);  
  WriteLn('OUTPUT DATA into portaudio------------------------------');
  WriteLn(st);
  {$endif}                  

tempmemory,outmemory not found  


Reply | Threaded
Open this post in threaded view
|

Re: Problem with some mp3 crashing

fredvs
Administrator
Hello.

> addfromfile
> AssignFile(F, Filename);
> FileMode:=fmOpenRead + fmShareDenyNone;  <-- added in

Ok, I will add this in next commit, thanks.

> I would have to create the EQ Bands each time a new song is played on playerindex0?
 
Yes.

>  if I add custom options Debug, I have several compile errors when targeting win 32.

Like explained in define.inc, debug-mode is allowed only for not-LCL (not-Lazarus) and no GUI Winddows projects.
It will work for console, fpgui and msegui applications.

> {$if defined(cpu64)}
>    PlugHandle:= 0;
>    {$else}
>    PlugHandle:= -1;  <-- out of range from type is positive value
>    {$ENDIF}      

Where did you found that code ?

The code of last commits is:

 {$IF DEFINED(windows)}
  PlugHandle:= 0;
  {$else}
  PlugHandle:= nil;
  {$endif}

---> https://github.com/fredvs/uos/

> In debug, tempmemory,outmemory not found  

OK, fixed, thanks.

Fre;D