gpt4 book ai didi

ios - 如何在 iOS 中录制音频并将其作为 NSData 获取?

转载 作者:行者123 更新时间:2023-11-28 19:36:01 25 4
gpt4 key购买 nike

我想在我的应用程序中记录一些内容并将其发布到某个 API。请帮忙

最佳答案

您可以点击此链接在本地 iPhone 存储(例如:文档目录)中录制和保存音频。

Record audio file and save locally on iPhone

保存后,您可以将文件内容转换为 NSData

NSDate *audioData = [NSData dataWithContentsOfFile:audioFilePath];
// audioFilePath is the path of audio either from document
// directory or any other location.

关于ios - 如何在 iOS 中录制音频并将其作为 NSData 获取?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38832457/

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