请问TMediaplayer播放mp3的条件是什么?我在Winxp下播不了。

Bors 2002-07-20 10:09:13
有人说是要装DirectX, 有人说要装Windows Media Player,
有人说装了Winamp就可以了。

但是在winxp下有Windows Media Player, Winamp, 同时我相信DirectX也是必装的。
但是一播放.mp3就提示“cannot determine the device type by the given filename extension.”

请教确切的要求是什么?
...全文
45 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
rh 2002-08-31
  • 打赏
  • 举报
回复
看看你的win.ini
要能正确根据扩展名找到相应的设备,win.ini不可或缺,里面应该有类似这样的段:
[MCI Extensions]
asf=MPEGVideo
asx=MPEGVideo
ivf=MPEGVideo
m3u=MPEGVideo
mp2v=MPEGVideo
mp3=MPEGVideo
mpv2=MPEGVideo
wax=MPEGVideo
wm=MPEGVideo
wma=MPEGVideo
wmv=MPEGVideo
wvx=MPEGVideo
wmp=MPEGVideo2
wmx=MPEGVideo2
wpl=MPEGVideo
fangoxyz 2002-08-31
  • 打赏
  • 举报
回复
cannot determine the device type by the given filename extension

不能通过给出的文件扩展名确定设备类型,是否是文件名或长文件名或文件中有空格的问题
Bors 2002-07-22
  • 打赏
  • 举报
回复
office组件或ie组件
是哪个组件呢?

是不是DirectMedia?
xiaoguoru 2002-07-22
  • 打赏
  • 举报
回复
我的怎么可以播放,我的版本是Media Player 7.1,后来更新为8.0,两者均可以播放.不过就要播放MP3来说,我觉得我应该还是用Winamp 好,因为MediaPlayer比较耗内存的.
xdspower 2002-07-22
  • 打赏
  • 举报
回复
不对,mp3只需要用mpeg2的解码器就可以了,你打开win.ini看看mci设备中相关的解码器是否定义了,还有就是你是否安装了其它的播放软件使解码器不标准而不被TMediaplayer支持。
wangxd 2002-07-22
  • 打赏
  • 举报
回复
主要是mediaplay的版本问题,6.4版本以上可以播放mp3
mfc42d 2002-07-22
  • 打赏
  • 举报
回复
使用mci播放mp3是限制的,它是微软自己的组件,如果不信,在win95/win97试一试就明白了,播放mp3必须安装office组件或ie组件
jishiping 2002-07-21
  • 打赏
  • 举报
回复
在WinAMP里,你可以选择哪些后缀的文件用WinAMP打开啊。我说了,这和
DirectX无关,不装DirectX,一样可以播放MP3文件。你只要在WinAMP的设
定里,将后缀为 mp3 的文件和WinAMP关联上就可以了。或者用我上面说的
方法也可以。
Bors 2002-07-21
  • 打赏
  • 举报
回复
难道WinXP会没有整合DirectX。

另外,
“cannot determine the device type by the given filename extension.”不是系统级的提示。已经装了winamp了。

我在我自己的机器上也没问题,但我同学在他的机器上有如是问题,故特来请教。

看来就是要装DirectX的问题了。

codecb 2002-07-21
  • 打赏
  • 举报
回复
同意JSP大侠

eastpa1980 2002-07-21
  • 打赏
  • 举报
回复
完全同意楼上的意见!!
hbxtx 2002-07-21
  • 打赏
  • 举报
回复
我的BCB6+XP,播放MP3没有问题.也不需要安装其他的东西.
jishiping 2002-07-21
  • 打赏
  • 举报
回复
DirectX不是必装的。你的那个错误信息是,后缀名 .mp3 没有和任一个程序
关联。简单的办法,在资源管理器里,双击 .mp3 结尾的文件,系统会提示
让你选择一个程序,用来打开这个文件,你选择一个文件,并且选择下面的
“始终使用该程序打开这些文件”就可以了。
Bors 2002-07-21
  • 打赏
  • 举报
回复
我说要DirectX是因为有人说TMediaplayer播放多媒体主要是调用MCI api, 而支持MP3是DirectMedia在工作。

不过,我记得windows xp刚装完时,.mp3已经关联在windows media player上了,怎么还会出现如此问题?

pp616 2002-07-20
  • 打赏
  • 举报
回复
IE5.0的mediaplay
一个自制MP3播放器(含原代码)这个程序的关键是BmpShape的应用。unit BmpShape;{2002/08/22 by ultrared根据BMP文件创建窗口注意:1. BMP文件最左上的一个点颜色作为背景色2. BmpShape控件只能用在TForm容器上3. BMP文件可以是256色或者24位色4。大块背景色必须和背景色绝对相等才能获得正常效果}interfaceuses Forms,Windows, Messages, SysUtils, Classes, Controls, ExtCtrls,Graphics;type TBmpShape = class(TImage) private { Private declarations } BackColor:TColor;//背景颜色 FColorDither:boolean;//是否允许背景颜色有一定的抖动 function GetRegion:HRGN;//前景图片的区域 procedure setColorDither(cd:Boolean); protected { Protected declarations } public { Public declarations } constructor Create(AOwner:TComponent);override; procedure Apply;//使用效果 published { Published declarations } property Dither:Boolean read FColorDither write setColorDither; end;procedure Register;implementationprocedure Register;begin RegisterComponents('Samples', [TBmpShape]);end;procedure TBmpShape.setColorDither(cd:Boolean);begin if cd<>FColorDither then FColorDither:=cd;end;constructor TBmpShape.Create(AOwner:TComponent);begin inherited Create(AOwner); BackColor:=RGB(0,0,0); FColorDither:=FALSE;end;//核心子程序,获得BMP图片的前景区域function TBmpShape.GetRegion:HRGN;var i,j:integer; rgn1,rgn2:HRGN; StartY:integer; r,g,b,r1,g1,b1:BYTE; cc:TColor;begin if Picture.Bitmap<>nil then begin BackColor:=Picture.Bitmap.Canvas.Pixels[0,0]; rgn1:=CreateRectRgn(0,0,0,0); for i:=0 to Picture.Bitmap.Width-1 do begin StartY:=-1; for j:=0 to Picture.Bitmap.Height-1 do begin cc:=Picture.Bitmap.Canvas.Pixels[i,j]; if FColorDither then begin //允许和背景有一定的色差 r:=(cc and $FF0000) shr 16; g:=(cc and $FF00) shr 8; b:=cc and $FF; r1:=(BackColor and $FF0000) shr 16; g1:=(BackColor and $FF00) shr 8; b1:=BackColor and $FF; if (abs(r-r1)<10) and (abs(g-g1)<10) and (abs(b-b1)<10) then begin if (StartY>=0) and (j>=StartY) then begin rgn2:=CreateRectRgn(i,StartY,i+1,j); CombineRgn(rgn1,rgn1,rgn2,RGN_OR); StartY:=-1; end; end else begin if Starty<0 then StartY:=j else if j=(Picture.Bitmap.Height-1) then //最下面一个点 begin rgn2:=CreateRectRgn(i,StartY,i+1,j); CombineRgn(rgn1,rgn1,rgn2,RGN_OR); end; end; end else //不允许色差 begin if cc=BackColor then begin if (StartY>=0) and (j>=StartY) then begin rgn2:=CreateRectRgn(i,StartY,i+1,j); CombineRgn(rgn1,rgn1,rgn2,RGN_OR); StartY:=-1; end; end else begin if Starty<0 then StartY:=j else if j=(Picture.Bitmap.Height-1) then //最下面一个点 begin rgn2:=CreateRectRgn(i,StartY,i+1,j); CombineRgn(rgn1,rgn1,rgn2,RGN_OR); end; end; end; end; end; result:=rgn1; end else result:=0;end;procedure TBmpShape.Apply;begin if Parent is TForm then begin Left:=0; Top:=0; Width:=Picture.Bitmap.Width; Height:=Picture.Bitmap.Height; with (Parent as Tform) do begin BorderStyle:=bsNone; Width:=Self.Width; Height:=Self.Height; end; SetWindowRgn(Parent.Handle,GetRegion,FALSE); end;end;end.

13,873

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧