gpt4 book ai didi

ios - 如何更改 AVPlayer 中播放音频的速度?

转载 作者:可可西里 更新时间:2023-10-31 23:55:36 28 4
gpt4 key购买 nike

我正在研究 AVPlayer。我已完成播放音频流的 PausePlayfastForward。我想在播放时更改音频流的播放速度。我搜索了很多,但没有得到准确的方向。所以,请帮我解决这个问题。

最佳答案

当前播放速率。

var rate: Float

文档

https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVPlayer_Class/#//apple_ref/occ/instp/AVPlayer/rate

A value of 0.0 means pauses the video, while a value of 1.0 play at the natural rate of the current item. Rates other than 0.0 and 1.0 can be used if the associated player item returns YES for the AVPlayerItem properties canPlaySlowForward or canPlayFastForward. Negative rate value ranges are supported if the player item returns YES for the canPlayReverse, canPlaySlowReverse, and canPlayFastReverse properties.

关于ios - 如何更改 AVPlayer 中播放音频的速度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37917149/

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