gpt4 book ai didi

iphone - 有没有办法在使用 AVPlayer 进行 HTTP 实时音频流时选择比特率?

转载 作者:太空狗 更新时间:2023-10-30 03:23:33 24 4
gpt4 key购买 nike

我正在使用 AVPlayer 流式传输以两种质量格式交付的音频内容。

问题是,当从较低格式传递到较高格式时(在 wi-fi 可用时由框架自动完成)播放时会出现延迟。

有没有办法手动选择所需的质量以防止这种延迟?

最佳答案

现在在 iOS8 中是可能的。

结帐 preferredPeakBitRate在 AVPlayerItem 上。

从 Apple 的文档中复制以下内容:

The desired limit, in bits per second, of network bandwidth consumption for this item.
SWIFT: var preferredPeakBitRate: Double
OBJECTIVE-C: @property(nonatomic) double preferredPeakBitRate

Set preferredPeakBitRate to non-zero to indicate that the player should attempt to limit item playback to that bit rate, expressed in bits per second.

If network bandwidth consumption cannot be lowered to meet the preferredPeakBitRate, it will be reduced as much as possible while continuing to play the item.

关于iphone - 有没有办法在使用 AVPlayer 进行 HTTP 实时音频流时选择比特率?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5327520/

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