小编jef*_*kit的帖子

iOS中的ExtAudioFileRead下载错误代码-50

我使用ExtAudioFileRead函数将音频文件加载到内存.但我发现代码-50总是出错.这意味着我将错误的参数传递给函数.但我不知道哪一个是错误的参数.

音频文件的数据格式为alac,sampleRate 44100k,有2个通道.

我的代码如下所示:

ExtAudioFileRef recordFile;
OSStatus error = noErr;
error = ExtAudioFileOpenURL((CFURLRef)file, &recordFile);
checkError(error, "open file");

SInt64 frameCount;
UInt32 size = sizeof(frameCount);
error = ExtAudioFileGetProperty(recordFile, kExtAudioFileProperty_FileLengthFrames, &size, &frameCount);
checkError(error, "get frameTotlal");

soundStruct *sound = &_sound;
sound->frameCount = frameCount;
sound->isStereo = true;
sound->audioDataLeft = (SInt16 *)calloc(frameCount, sizeof(SInt16));
sound->audioDataRight = (SInt16 *)calloc(frameCount, sizeof(SInt16));

AudioStreamBasicDescription desc;
UInt32 descSize = sizeof(desc);
error = ExtAudioFileGetProperty(recordFile, kExtAudioFileProperty_FileDataFormat, &descSize, &desc);


[self printASBD:desc];

UInt32 channels = desc.mChannelsPerFrame;

error = ExtAudioFileSetProperty(recordFile, kExtAudioFileProperty_ClientDataFormat, sizeof(inFormat), &inFormat);

AudioBufferList *bufferList;
bufferList = …
Run Code Online (Sandbox Code Playgroud)

core-audio extaudiofile ios

7
推荐指数
1
解决办法
2067
查看次数

innoDB上的慢计数(*)

我有一个message_message包含3000000条记录的表。

当我进行count(*)查询时,它非常慢...:

mysql> select count(*) from message_message;

+ ---------- +

| count(*)|

+ ---------- +

| 2819416 |

+ ---------- +

一组1列(2分35.35秒)

解释一下:mysql> explain select count(*) from message_message;

| id | select_type | 桌子| 类型 可能的钥匙| 关键 key_len | 参考| 行|额外|

| 1 | 简单 message_message | 索引| NULL | 主要| 4 | NULL | 2939870 | 使用索引

设置1行(0.02秒)

发生什么事?

mysql performance count

4
推荐指数
1
解决办法
4176
查看次数

标签 统计

core-audio ×1

count ×1

extaudiofile ×1

ios ×1

mysql ×1

performance ×1