ios - 将 AVAudioRecorder 转换为 NSString 或 bytes

标签 ios json avaudiorecorder

我正在尝试在 Json 中发送 AVAudioRecorder , 我想将它转换为 NSString 或 Byte.. 有什么想法吗?

最佳答案

从未尝试过,但也许是这个?

// Get the recording
AVAudioRecorder *recorder = [[AVAudioRecorder alloc] initWithURL:filePath settings:recordSetting error:&error];
....
// Convert to NSData
NSData *theData = [[NSData alloc] initWithContentsOfFile:filePath];
// Convert to NSString
NSString* dataAsString = [NSString stringWithUTF8String:[theData bytes]];

关于ios - 将 AVAudioRecorder 转换为 NSString 或 bytes,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20310231/

相关文章:

json - mime 类型设置

ios - AVAudioRecorder最小的音频类型是什么

ios - 如何检测屏幕自动锁定是否启用

json - 简化 JSON 结构

iphone - UITableViewCell 中的 imageView UITapGestureRecognizer

javascript - 从javascript中的url同步解析json

ios - 使用 AVAssetExportSession 连接后 m4a 音频比特率增加

ios - 如何快速提高 AV 录制质量。我要高清录像

ios - 如何找到 iphone 相机照片的大小以及如何调整它的大小?

ios - 没有der文件的RSA加密