我在编码wav文件中看到了一个示例,这是示例
这部分代码有疑问:
/* 编码单音声音 */
float t, tincr;
t = 0;
tincr = 2 * M_PI * 440.0 / c->sample_rate;
for(i=0; i<2000; i++) {
for(j=0;j<frame_size;j++) {
samples[2*j] = (int)(sin(t) * 10000);
samples[2*j+1] = samples[2*j];
t += tincr;
}
/* encode the samples */
这里的2000是多少,根据我们必须给出的值,因为我的编码不正确,任何建议都会有帮助
最佳答案
它似乎是构成样本的任意数量的重复“帧”。在不同的代码路径中,它以类似的方式构造另一种类型的波形并提到2000=>52sec
。
关于objective-c - 示例的编码 wav 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42409197/