简体   繁体   English

使用Flash / ActionScript 3流音频-播放缓慢

[英]Streaming audio with Flash / Actionscript 3 - Slow playback problem

I've written a simple Flash player for a Shoutcast stream. 我为Shoutcast流编写了一个简单的Flash播放器。 At first it seemed to work reliably, however about 5% of the time users experience slow playback where the stream plays at roughly half of normal speed. 起初它似乎可靠地工作,但是大约有5%的时间用户体验慢速播放,而流的播放速度约为正常速度的一半。

All files being streamed are MP3, encoded at 128kbps/44.1kHz, the same settings as used in the Shoutcast config files, so the issue is not caused by mismatched bit rates as suggested on a number of forums I have read. 正在流式传输的所有文件都是MP3,编码为128kbps / 44.1kHz,与Shoutcast配置文件中使用的设置相同,因此,该问题并非由我在许多论坛上建议的比特率不匹配引起。 Has anyone else encountered this problem and possibly found a solution? 是否还有其他人遇到此问题并可能找到解决方案?

Regards, 问候,
Alan 艾伦

EDIT: A sample player can be found at http://radionations.com/utils/players/pulse.swf There is no graphical display as the player is designed to run in the background. 编辑:可以在http://radionations.com/utils/players/pulse.swf上找到一个示例播放器。由于该播放器被设计为在后台运行,因此没有图形显示。

The problem only occurs a small proportion of the time, and only when the player is being loaded in the browser. 仅在很小一部分时间内,仅在将播放器加载到浏览器中时,才出现此问题。 It does not occur mid-stream. 它不会发生在中间。

The player has been tested on a number of different machines running Windows XP, Vista, Ubuntu, and MacOS X. Various different hardware configurations are involved. 该播放器已在运行Windows XP,Vista,Ubuntu和MacOS X的许多不同计算机上进行了测试。涉及各种不同的硬件配置。 The problem occurs across all of these test platforms so I am inclined to believe it is not an issue with problematic / buggy audio drivers. 该问题在所有这些测试平台上均会发生,因此我倾向于认为这与有问题的/错误的音频驱动程序无关。

I have encountered the problem both with and without other applications using the audio device. 无论是否使用音频设备的其他应用程序,我都遇到了问题。

EDIT: I'm surprised I still haven't found a solution to this problem. 编辑:我很惊讶我仍然没有找到解决此问题的方法。 So I've decided to come back to it now in the hopes that somebody might know something. 因此,我决定现在重新讨论它,希望有人可能知道一些事情。 Any help is greatly appreciated. 任何帮助是极大的赞赏。

Thanks, Alan 谢谢,艾伦

This is a flash player bug unfortunately. 不幸的是,这是一个Flash Player错误。 It seems like the only reliable solution is to roll it back to AS2. 似乎唯一可靠的解决方案是将其回滚到AS2。

https://bugs.adobe.com/jira/browse/FP-173 https://bugs.adobe.com/jira/browse/FP-173

I made a very simple player that streams from your server and it also had that problem. 我做了一个非常简单的播放器,它从您的服务器流式播放,并且也存在该问题。 Very intriguing... I then made it start the sound a little bit later, after it loaded 100K and it seems to be working, I don't have time to test it more right now though. 非常有趣……我随后使它开始播放声音,加载了100K之后似乎可以正常工作了,但是现在我没有时间进行更多测试。 You can get it here http://rromania.ro/sc/sc.rar 您可以在这里获得它http://rromania.ro/sc/sc.rar

I've been successfully using: 我已经成功使用:

s.load(new URLRequest(mp3),new SoundLoaderContext(3000)); s.load(新的URLRequest(mp3),新的SoundLoaderContext(3000)); // 3000 is 3sec buffer time // 3000是3秒的缓冲时间

I can't be 100% sure, but since I've been buffering it I haven't noticed any slow play from many reloads. 我不能百分百确定,但是由于一直在缓冲它,所以我没有注意到许多重装过程中的任何缓慢播放。

Hope this helps. 希望这可以帮助。

分派complete事件后等待6秒,以便它下载足够的数据以正常速度运行,并尝试了很多次之后,它似乎仍能正常工作

I believe that the slow playing is caused by audio drivers problems. 我认为播放缓慢是由音频驱动程序问题引起的。 Can you give a link to the player? 您可以给播放器链接吗?

I have encountered the slow playing problem in your player, about 25% of the times I reloaded it, but only if another application using the audio device is running when the stream starts playing, as I reckon after a quick look. 我在播放器中遇到了播放缓慢的问题,大约是我重新加载播放器时的25%,但是只有当流开始播放时,另一个使用音频设备的应用程序正在运行时,我才快速浏览一下。 Maybe you should test this situation on multiple computers. 也许您应该在多台计算机上测试这种情况。 I would guess that it's an audio driver problem, I'm using XP 64 and my audio drivers are beta. 我猜这是一个音频驱动程序问题,我使用的是XP 64,而我的音频驱动程序是beta。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM