WAV 形式は通常、44 バイトのヘッダーで始まり、その後に 1 秒あたり 44,100 回 (サンプル レート) 取得されたオーディオ サンプルが続きます。各サンプルは 16 ビットの符号付き整数リトルエンディアン (ビット深度) です。ビット レートは、これら 2 つの基本的な要素を乗算して計算されます。 (サンプルレート) * (ビット深度) ... これはモノラルなので、ステレオの場合、これらのサンプルはインターリーブされます
参照する API を見て、最初にプローブ プロパティ: vbr (可変ビット レート) が true の場合、必要な計算は達成できません。WAV の場合、常に一定のビット レートにする必要があります (つまり、false)。次に、プロパティを取得します: ビットレート
ビットレート = (sample_rate) * (bit_depth) * (number_of_channels) === ビット/秒
For argument sake lets say your ...
sample_rate = 44100; // 44.1 kHz which is typical
bit_depth = 16; // also typical
number_of_channels = 2; // mono --> 1 stereo --> 2
look_ahead_milli_sec = 1500; // you are given this in milliseconds
bit_rate = sample_rate * bit_depth * number_of_channels;
bit_rate = 44100 * 16 * 2;
bitrate = 1411200; // based on above calculation
bytes_per_second = bitrate / 8; // bits to bytes per sec
bytes_per_second = 1411200 / 8; // bits to bytes per sec
bytes_per_second = 176400; // bytes per sec
look_ahead_in_bytes = (bytes_per_second / 1000) * look_ahead_milli_sec;
look_ahead_in_bytes = (176400 / 1000) * 1500;
look_ahead_in_bytes = 264600;