gpt4 book ai didi

javascript - 在 SoundManager2 中播放 AAC 无法启动

转载 作者:行者123 更新时间:2023-12-03 00:56:52 29 4
gpt4 key购买 nike

我将音频文件 MP4 转换为 AAC,然后想在 SoundManager2 中播放该文件。如果我使用一些适用于 Windows 的软件进行转换,一切都很好,音频播放良好。但是,在服务器端,当使用 ffmpeg 将 MP4 文件转换为 AAC 时,文件在 SM2 中加载,但没有开始播放。

我使用这个命令:

ffmpeg -i in.mp4 out.aac

这是 SoundManager2 日志:
-- SoundManager 2: HTML5 support tests (/^(probably|maybe)$/i): mp3: true (preferring flash), mp4: true (preferring flash), ogg: true, wav: true -- soundmanager2.js:1156
-- SoundManager 2 V2.97a.20120916 (AS3/Flash 9) + HTML5 audio, high performance mode, custom (1ms) polling, wmode: transparent, flash debug mode, flashBlock mode -- soundmanager2.js:1156
soundManager::createMovie(): Trying to load /soundmanager/swf/soundmanager2_flash9_debug.swf soundmanager2.js:1156
soundManager::initMovie(): Waiting for ExternalInterface call from Flash... soundmanager2.js:1158
soundManager::externalInterfaceOK() (~0 ms) soundmanager2.js:1158
soundManager::init() soundmanager2.js:1158
soundManager: Attempting JS to Flash call... soundmanager2.js:1158
(Flash): SM2 SWF V2.97a.20120916 (AS3/Flash 9) soundmanager2.js:1158
Flash security sandbox type: remote soundmanager2.js:1158
(Flash): JS to/from Flash OK soundmanager2.js:1158
(Flash): Enabling polling, 1 ms interval soundmanager2.js:1158
-- SoundManager 2 loaded (OK) -- soundmanager2.js:1156
soundManager: Firing 1 onready() item soundmanager2.js:1158
threeSixtyPlayer.init() soundmanager2.js:1158
threeSixtyPlayer.init(): Found 1 relevant items. soundmanager2.js:1158
handleClick() soundmanager2.js:1158
soundManager.createSound(): ui360Sound0 (http://[private url]/out.aac?v=1350309261) soundmanager2.js:1156
soundManager.createSound(): Enabling usePolicyFile for data access soundmanager2.js:1158
SMSound() merged options: {
id: ui360Sound0,
url: http://[private url]/out.aac?v=1350309261,
onplay: { pl.removeClass(this._360data.oUIBox,this._360data.className); t... },
onstop: { pl.removeClass(this._360data.oUIBox,this._360data.className); t... },
onpause: { pl.removeClass(this._360data.oUIBox,this._360data.className); t... },
onresume: { pl.removeClass(this._360data.oUIBox,this._360data.className); t... },
onfinish: { var nextLink; pl.removeClass(this._360data.oUIBox,this._360data... },
onbufferchange: { if (this.isBuffering) { pl.addClass(this._360data.oUIBox,pl.css... },
whileloading: { if (this.paused) { self.updatePlaying.apply(this); } }... },
whileplaying: { self.updatePlaying.apply(this); this._360data.fps++; }... },
useWaveformData: false,
useEQData: false,
usePeakData: true,
autoLoad: false,
autoPlay: false,
loops: 1,
multiShot: true,
multiShotEvents: false,
pan: 0,
stream: true,
usePolicyFile: true,
volume: 50,
useMovieStar: false,
isMovieStar: false,
bufferTime: 3
} soundmanager2.js:1158
(Flash): SoundManager2_SMSound_AS3: Got duration: 0, autoPlay: false soundmanager2.js:1158
SMSound.play(): Attempting to load "ui360Sound0" soundmanager2.js:1156
SMSound.load(): http://[private url]/out.aac?v=1350309261 soundmanager2.js:1156
SMSound.play(): "ui360Sound0" is starting to play soundmanager2.js:1158
fanOut: ui360Sound0: http://[private url]/out.aac?v=1350309261 soundmanager2.js:1158
(Flash): start (ui360Sound0): 0 soundmanager2.js:1158
SMSound._onbufferchange(): 1 soundmanager2.js:1158
SMSound._onbufferchange(): 0 soundmanager2.js:1158
SMSound._onload(): "ui360Sound0" loaded.

有什么问题?

最佳答案

SoundManager 仅(完全)支持 MPEG-4 AAC 音频。您尝试播放的文件可能是 MPEG-2 Part 7 中定义的 AAC 的“非向后兼容”版本。 :

Part 7 (ISO/IEC 13818-7) of the MPEG-2 standard specifies a rather different, non-backwards-compatible audio format (also known as MPEG-2 NBC). Part 7 is referred to as MPEG-2 AAC.



据我所知,只有 Safari (QuickTime) 会播放这些文件。 Chrome 或 Flash 都不会播放这些文件。但是,MPEG-2 AAC 文件的 MIME 类型与 MPEG-4 变体相同,因此在您尝试播放之前几乎不可能知道该文件无法播放。 (当被问到时,MPEG-LA 回答“因为你他妈的,这就是原因。”)

关于javascript - 在 SoundManager2 中播放 AAC 无法启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12897208/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com