计算mp3帧的以毫秒为单位的长度 [英] Calculating the length of MP3 Frames in milliseconds

查看:922
本文介绍了计算mp3帧的以毫秒为单位的长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以说以字节为单位的MP3帧长为104:如何获取以毫秒为单位?有没有什么公式什么的做到这一点?

解决方案

我用不同的方法来计算的MP3文件的每一帧的时间

.. 假设所有帧具有相同大小的文件中..所以,我会在毫秒..然后计算出文件中的总帧数,最后分的总时间由总帧数mp3文件的总时间..所以公式看起来这样的:

 浮法frameTime的= totalTimeMillisec / totalFrames;
 

您将获得在以毫秒为单位的轨迹每一帧的总时间... 之后,我做了,我得到了各地的52毫秒......这是类似于马克·希思说。

不管怎样谢谢大家的解决方案。

Lets say one MP3 Frame length in bytes is 104: how to get that in milliseconds? Is there any formula or something to do that?

解决方案

I used different approach to calculate the time of every frame in the mp3 file.. assuming that all frames have same size in the file.. so I just get the total time of the mp3 file in milliseconds.. then calculate total frames in the file and finally divide the total time by total frames.. so the formula would look like:

float frameTime = totalTimeMillisec / totalFrames;

you will get the total time of every frame in the track in milliseconds.. after I done that I got around 52 milliseconds... and that was similar to what Mark Heath said..

anyway thanks everybody for the solutions..

这篇关于计算mp3帧的以毫秒为单位的长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆