Flex 4 声音类别 - 检测 .mp3 的采样率
我正在开发一个用 Flex 4 编写的 Adobe Air 应用程序,该应用程序可以在用户计算机上播放 .mp3 音频文件。注意:这些不是应用程序附带的音频文件 - 它们是用户计算机上选择通过应用程序播放的 .mp3 文件。
该应用程序适用于以 44.1 kHz 编码的 .mp3,但如果使用其他采样率,可能会产生不可预测的结果。我做了很多研究来了解 Sound 类的局限性以及 .mp3 基本上如何成为我在 Flex 中的唯一选择。
我的问题是:有没有办法检测 Flex 4 ActionScript 中 .mp3 音频的采样率?
此时,我只想捕获这些情况并防止加载非 44.1 kHz 采样率的文件,而不是担心应用程序能否在非标准采样率下正常运行。
具体来说:例如,如果用户选择以 48 kHz 编码的 .mp3 进行播放,我希望能够检测到这种情况并采取措施阻止文件加载,然后向用户宣布:这不是受支持的音频文件。
提前致谢, 菲茨
I'm working on an Adobe Air application written in Flex 4 that plays .mp3 audio files on the user's computer. Note: these are are not audio files shipped with the application -- they are .mp3's on the user's computer that they select for playback through the application.
The application works fine for .mp3s encoded at 44.1 kHz, but can give unpredictable results if other sample rates are used. I've done plenty of research to know the limitations of the Sound class and how .mp3 will basically be my only option in Flex.
My question is: Is there a way to detect the sample rate of the .mp3 audio in Flex 4 ActionScript?
Rather than worry about making the application work well with non-standard sample rates, at this point I'd like to just catch those cases and prevent files with non-44.1 kHz sample rates from loading.
To be specific: if a user selects an .mp3 for playback that has been encoded at 48 kHz, for example, I'd like to be able to detect that case and take action preventing the file from loading and then announce to the user that this is not a supported audio file.
Thanks in advance,
Fitz
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 mp3infoutil
Use mp3infoutil