gpt4 book ai didi

swift - 如何快速使用 CFURLCreateFromFileSystemRepresentation ?

转载 作者:行者123 更新时间:2023-11-30 12:46:12 25 4
gpt4 key购买 nike

我正在使用audioQueueService进行开发但停止在函数“CFURLCreateFromFileSystemRepresentation”中这是我的代码,但总是返回 nil。

var path = Bundle.main.path(forResource: "123", ofType: "mp3")!

var xyz = UInt8(path.utf8CString[0])

let audioFileURL =  CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault,&xyz, path.characters.count, false)

print(audioFileURL)

我尝试过将路径的点发布到 func 但不起作用?谁能帮助我吗?

最佳答案

let url = Bundle.main.url(forResource: "123", withExtension: "mp3")!

let audioFileURL = url as CFURL

关于swift - 如何快速使用 CFURLCreateFromFileSystemRepresentation ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41609340/

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