Flex / Actionscript通过分析audioBytesPerSecond来确定NetStream是否具有音频(Flex/Actionscript determine if NetStrea

编程入门 行业动态 更新时间:2024-10-26 05:32:14
Flex / Actionscript通过分析audioBytesPerSecond来确定NetStream是否具有音频(Flex/Actionscript determine if NetStream has audio by analysing audioBytesPerSecond)

我需要“查看”NetStream并确定我是否收到音频。 根据我的调查,我可以使用NetStreamInfo中的属性audioBytesPerSecond:

“(audioBytesPerSecond)指定填充NetStream音频缓冲区的速率,以每秒字节数为单位。该值计算为最后一秒收到的音频数据的平滑平均值。”

我还了解到NetStream可能包含来自网络的一些开销字节,这是确定NetStream是否正在播放音频(而不仅仅是噪声)的最小合理audioBytesPerSecond值? 这种分析可以这样做吗?

提前致谢!

I need to "look" at a NetStream and determine if I'm receiving audio. From what I investigated, i may use the property audioBytesPerSecond from NetStreamInfo:

"(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."

I also learned that NetStream may have contain some overhead bytes from the network so, which is the minimum reasonable audioBytesPerSecond value to determine if NetStream is playing audio (and not just noise, for example)? Can this analysis be done this way?

Thanks in advance!

最满意答案

是的,你可以这样做。 然而,这是相当主观的。

尝试找到适合您的阈值。 我们过去使用了5千比特/秒。 如果数据量低于此值,则可能不会发送任何音频。 注意,我们使用的是stream.info.byteCount属性(如果您使用的是auiodBytesPerSecond则可能需要略低的值)。

如果您对着麦克风讲话并定期检查audioBytesPerSecond或其他可用的计数器/统计信息,这很容易观察到。

Yes you can do it this way. It's rather subjective, however.

Try to find a threshold that works for you. We used 5 kilobits/sec in the past. If the amount of data falls below this value, they are likely not sending any audio. Note, we were using the stream.info.byteCount property (you might want a slightly lower value if you're using auiodBytesPerSecond).

This is pretty easy to observe if you speak into the microphone and periodically check audioBytesPerSecond or the other counters/statistics that are available.

更多推荐

本文发布于:2023-07-29 18:33:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1318669.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:音频   audioBytesPerSecond   Flex   Actionscript   NetStream

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!