OStack程序员社区-中国程序员成长平台

标题: ios - 为 AVFoundationAudioSettings 设置 AVAudioTimePitchAlgorithmVarispeed [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 07:58
标题: ios - 为 AVFoundationAudioSettings 设置 AVAudioTimePitchAlgorithmVarispeed

根据这些docs ,我可以更改 AVAudioPlayer 的某些设置,包括 AVAudioTimePitchAlgorithmVarispeed 设置。我将如何设置这个值?我需要继承 AVAudioSetting.h 吗?



Best Answer-推荐答案


如果不需要使用AVAudioPlayer,可以使用AVPlayer

AVPlayerItem *playerItem = [AVPlayerItem playerItemWithURL:url];
playerItem.audioTimePitchAlgorithm = AVAudioTimePitchAlgorithmTimeDomain;
AVPlayer *player = [AVPlayer playerWithPlayerItem:playerItem];
[player play];

关于ios - 为 AVFoundationAudioSettings 设置 AVAudioTimePitchAlgorithmVarispeed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23879194/






欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) Powered by Discuz! X3.4