gpt4 book ai didi

iphone - AVAudioPlayer出现错误?

转载 作者:行者123 更新时间:2023-12-01 16:59:57 33 4
gpt4 key购买 nike

AVAudioPlayer出现如下错误:
The operation couldn’t be completed. (OSStatus error 1954115647.)
我使用NSURLConnection从某个URL下载了音频mp3文件,它是downloading 100%,并以BLOB格式保存到DB。

然后我尝试像这样从AVAudioPlayer播放该文件:

AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithData:data error:&error];
if (player == nil)
{
NSLog(@"AudioPlayer did not load properly: %@", [error localizedDescription]);
}
else
{
[player play];
}

我在这做错了什么?

最佳答案

您是否尝试过使用URL初始化AVAudioPlay并将URL指向blob文件?

(id)initWithContentsOfURL:(NSURL *)url error:(NSError **)outError

它通过本地URL设置对我有用。

关于iphone - AVAudioPlayer出现错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8050472/

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