Ver Mensaje Individual
  #1  
Antiguo 30-08-2015
tarco35 tarco35 is offline
Miembro
 
Registrado: sep 2003
Posts: 210
Reputación: 21
tarco35 Va por buen camino
Error calculando duración MP3

Hola, tengo el siguiente codigo de delphi 6:
Código Delphi [-]

type
  HMSRec = record
    Hours: byte;
    Minutes: byte;
    Seconds: byte;
    NotUsed: byte;
  end;

// y ya en código

  If OpenDialog1.Execute then begin
    Label16.Caption := OpenDialog1.FileName;
    MediaPlayer1.FileName := OpenDialog1.FileName;
    MediaPlayer1.Open;
    MediaPlayer1.Rewind;
    MediaPlayer1.TimeFormat := tfHMS;
    TheLength := MediaPlayer1.Length;
    with HMSRec(TheLength) do { Typecast TheLength as a HMSRec record }
    begin
      Label17.Caption := IntToStr(Hours);
      Label17.Caption := Label17.Caption+'H ' + IntToStr(Minutes) + 'M ';
      Label17.Caption := Label17.Caption+ IntToStr(Seconds)+ 'S ';
    end;
  end;

Y cuando selecciono un archivo MP3 el tiempo no lo hace bien, el fichero lo reproduzco con el VLC, por ejemplo y esta bien y la duracción que dice si es real, pero en este codigo, sacado de la ayuda, da unos valores muy diferentes.

Que estoy haciendo mal???
Gracias
Responder Con Cita