GARANTIR DESCONTO

Fórum TMediaPlayer não funciona! #181748

12/09/2003

0

Tenho um componente TMediaPlayer. Quando tento executar (ouvir) o arquivo de áudio, recebo o
seguinte erro: ´No MCI device open´.

O que estou fazendo de errado??



===============
Código:
===============
var
MP : TMediaPlayer;
Length : integer;
begin
MP := TMediaPlayer.Create(Self);
MP.Parent := Self;
MP.Visible := false;
MP.TimeFormat := tfHMS;
MP.FileName := ´C:\98.wav´;
Length := MP.Length;
LabelTempo.Caption := IntToStr(HMSRec(Length).Hours)+´:´+IntToStr(HMSRec(Length).Minutes)+´:´+IntToStr(HMSRec(Length).Seconds);
MP.Play;
end;



Grato,
Marcos


Atomix

Atomix

Responder

Posts

12/09/2003

Cebikyn

Tente:

var
MP : TMediaPlayer;
Length : integer;
begin
MP := TMediaPlayer.Create(Self);
MP.Parent := Self;
MP.Visible := false;
MP.TimeFormat := tfHMS;
MP.FileName := ´C:\98.wav´;
MP.Open;    // <---
Length := MP.Length;
LabelTempo.Caption := .......
MP.Play;
MP.Close  // <---
end;



Responder

Gostei + 0

13/09/2003

Alysson

num program chat q eu fiz, tinha um player..... eu tive q seleciona um arquivo qualquer do media player antes de compilar...... e o device é Auto Select.......



depois vc muda o arquivo pelo FileName....
mas o problema é q quando abro um arquivo q ele n consegue abri, ok..... da erro e tudo.... mas n consigo restaurar o player....... fica dando erro até mesmo com os arquivos legítimo.......
aí eu tenho q reiniciar a aplicação......


Responder

Gostei + 0

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar