请问,怎么从一个mp3文件中剪切一段并保存为文件? 怎么判断mp3文件可以播放多久?谢谢!

wenminghu 2005-01-17 09:32:13
哪里有例子可以参考啊?或者什么库有这个功能?谢谢!
...全文
227 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
httpaspjspphp 2005-01-24
  • 打赏
  • 举报
回复
IMediaSeeking::GetDuration
The GetDuration method retrieves the duration of the stream.

Syntax

HRESULT GetDuration(
LONGLONG *pDuration
);

Parameters

pDuration

[out] Pointer to a variable that receives the duration, in units of the current time format.

IMediaSeeking::GetCurrentPosition
The GetCurrentPosition method retrieves the current position, relative to the total duration of the stream.

Syntax

HRESULT GetCurrentPosition(
LONGLONG *pCurrent
);

Parameters

pCurrent

[out] Pointer to a variable that receives the current position, in units of the current time format.

Return Value

Returns an HRESULT value. Possible values include the following.

13seele 2005-01-22
  • 打赏
  • 举报
回复
CComPtr< IMediaSeeking> pMS;
REFERENCE_TIME dr = 1000;
pMS->SetPositions(&dr, AM_SEEKING_AbsolutePositioning, NULL,AM_SEEKING_NoPositioning);
pMS->GetDuration(&dr);
winne_ll 2005-01-22
  • 打赏
  • 举报
回复
MP3文件任意截取一段数据就可以播放了,它会自动定位头信息的。
nonocast 2005-01-22
  • 打赏
  • 举报
回复
MAD
Oversense 2005-01-21
  • 打赏
  • 举报
回复
mp3文件是分段的,也就是说任意取出其中的一段,都可以正确播放,你就直接用2进制工具copy一段出来就ok,判断播放多久,需要数里面有多少段,然后查看断头,看每个段可以放多久
gjd111686 2005-01-17
  • 打赏
  • 举报
回复
Windows Media SDK的帮助文档

2,554

社区成员

发帖
与我相关
我的任务
社区描述
专题开发/技术/项目 多媒体/流媒体开发
社区管理员
  • 多媒体/流媒体开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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