给定一个持续时间为 10 秒的音频文件,我如何找出 2 秒和 8 秒之间的样本数?
最佳答案
如果是 LPCM(例如未压缩),则使用采样率。
在伪代码中:
double sampleRate = audioFile.getSampleRate();
// you may also need to account for channel count here
size_t sampleCount = sampleRate * (8-2);
-- 其中 (8-2)
表示“介于 2 和 8 之间”
关于ios - 如何根据音频文件的长度计算样本数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4895639/