我正在使用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/