FMS:Flash动作脚本3.0:如何获取从FMS流式传输的mp3文件的比特率

发布于 2024-07-13 05:25:05 字数 161 浏览 6 评论 0原文

我需要获取 mp3 文件的比特率,该文件在 flash 动作脚本中作为 netstream 对象进行流式传输。 我正在使用 Flash Media Server 3.2。

我需要比特率来使用以下公式计算 mp3 文件的持续时间: 持续时间 = 文件大小(以字节为单位)/比特率

I need to get the bit rate of a mp3 file which is being streamed as a netstream object in flash action scripting. I am using Flash Media Server 3.2.

I need the bitrate to calculate the duration of the mp3 file using the formula:
Duration = file size in bytes / bitrate

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

つ低調成傷 2024-07-20 05:25:06

我不太确定 MP3 流媒体,但在我看来,比特率信息可能作为元数据标头的一部分提供。 为什么不尝试定义流的 clientonMetaData() 方法,并查看它包含什么内容?

编辑:替代想法:编写一个简单的服务器端脚本来确定比特率,并与流分开查询此信息。

I'm not really sure about MP3 streaming, but it seems likely to me that the bitrate information is available as part of the metadata header. Why don't you try to define the onMetaData() method of the stream's client, and see what it contains?

Edit: Alternative idea: write a simple server side script to determine the bitrate, and query this information separately from the stream.

妄想挽回 2024-07-20 05:25:06

您是否尝试过 NetStreamInfo 类(可通过 NetStream.info 访问)?

音频字节每秒

指定速率
NetStream 音频缓冲区已填满
每秒字节数。 其值为
计算为平滑平均值
最近收到的音频数据
第二。

每秒播放字节数

返回流播放速率
每秒字节数。 播放缓冲区
可以包含各种内容
播放列表。 该酒店提供
播放速率紧密匹配
当前播放的比特率
流。

看来里面有很多有用的信息。

Have you tried the NetStreamInfo class (accessible via NetStream.info)?

audioBytesPerSecond

Specifies the rate at which the
NetStream audio buffer is filled in
bytes per second. The value is
calculated as a smooth average for the
audio data received in the last
second.

playbackBytesPerSecond

Returns the stream playback rate in
bytes per second. The playback buffer
can contain content of various
playlists. This property provides the
playback rate that closely matches the
bit rate of the currently playing
stream.

Looks like there's lots of useful info in there.

怪我鬧 2024-07-20 05:25:06

问题解决了,问题出在 Flash 播放器上,我使用的是版本 9,版本 10 中的 NetStreamInfo 类确实提供了版本 9 中不可用的 mp3 文件的比特率。非常感谢所有帮助人员! !

The problem is solved, the problem was with the flash player, i was using version 9, with version 10 the NetStreamInfo class does provide the bitrate for the mp3 file which was not available in version 9. Thanks a lot for all the help guys!!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文