VCD 光蝶里面的文件是 *.DAT 的我用mediaplayer控件制作了一个播放器,播放类型用自动选择,它不能播放*.DAT文件,但是将Dat文件的扩展名改成.mpg 就可以播了,我已经试过了mediaplayer可选的所有播放类型,请问有没有其他方法能直接播放Dat文件 而不用该扩展名!另外一个问题是:有些VCD文件的文件用mediaplayer控件作的播放器播不出人唱歌的声音,只有音乐伴奏,我用超级解霸,就能播出人声和伴奏两个声道,用WindowsMediaplayer9.0 播也是只有伴奏,但是可以通过切换声道来听到人声,可见这些文件是默认了单声道输出。请教高手,我怎么才能让mediaplayer控件作的播放器也能切换左右声道,和立体声 呢? 我试过了 用 mcisendstring 函数 设置 left on 或right on 都没用,好像这只能够控制从左音箱输出或右边音箱输出,不能真正控制左右声道,超级解霸的左右声道就很强。请高手赐教,不胜感激!

解决方案 »

  1.   

    第一个问题应是你的注册表的问题,第二个问题还不明白
    第一个问题可用如下代码解决:
    procedure TForm_Main.AddExt(TheExt: String);
    var MyFile:TIniFile;
        MyReg:TRegistry;
        TheExt:String;
    begin
      TheExt:="dat";
      MyFile:=TIniFile.Create('Win.ini');
      if (MyFile.ValueExists('mci extensions','mpg')) and (not MyFile.ValueExists('mci extensions',TheExt)) then
      begin
        MyFile.WriteString('mci extensions',TheExt,MyFile.ReadString('mci extensions','mpg','MPEGVideo'));
      end;
      if (MyFile.ValueExists('mci extensions','mpeg')) and (not MyFile.ValueExists('mci extensions',TheExt)) then
      begin
        MyFile.WriteString('mci extensions',TheExt,MyFile.ReadString('mci extensions','mpeg','MPEGVideo'));
      end;
      MyFile.Free;
      MyReg:=TRegistry.Create;
      MyReg.Access:=KEY_ALL_ACCESS;
      MyReg.RootKey:=HKEY_LOCAL_MACHINE;
      if MyReg.OpenKey('\Software\Microsoft\Windows NT\CurrentVersion\MCI Extensions', False) then
      begin
        if (MyReg.ValueExists('mpg')) and (not MyReg.ValueExists(TheExt)) then
        begin
          MyReg.WriteString(TheExt,MyReg.ReadString('mpg'));
        end;
        if (MyReg.ValueExists('mpeg')) and (not MyReg.ValueExists(TheExt)) then
        begin
          MyReg.WriteString(TheExt,MyReg.ReadString('mpeg'));
        end;
      end;
      MyReg.CloseKey;
      MyReg.RootKey:=HKEY_CLASSES_ROOT;
      if (MyReg.KeyExists('.mpg')) and (not MyReg.KeyExists('.'+TheExt)) then
      begin
        MyReg.MoveKey('.mpg','.'+TheExt,false);
      end;
      if (MyReg.KeyExists('.mpeg')) and (not MyReg.KeyExists('.'+TheExt)) then
      begin
        MyReg.MoveKey('.mpeg','.'+TheExt,false);
      end;
      MyReg.CloseKey;
      MyReg.Free;
    end;
      

  2.   

    glom 谢谢,我去试一下再说
      

  3.   

    温度值在-10度……120度,用不同的颜色表示,分辨率为1度,
    如何处理,
    如果把TCOLOR的值均分好像不太好,至少-10度和10 读的颜色用肉眼分辨不出来!
      

  4.   

    [Error] Unit1.pas(28): Undeclared identifier: 'TIniFile'
    [Error] Unit1.pas(33): Missing operator or semicolon
    [Error] Unit1.pas(33): Incompatible types: 'TComponent' and 'String'
    你帮我看一下怎么回事?