|
|
|
|
@ -111,10 +111,21 @@ int main() {
|
|
|
|
|
REQUIRE(masks.size() == 960); |
|
|
|
|
for (int i = 0; i < 960; ++i) REQUIRE(masks[i] == (i >= 480) && capture[i] == 1234); |
|
|
|
|
voice.stop(); reset(); |
|
|
|
|
pulls = 0; output_position = 0; |
|
|
|
|
REQUIRE(voice.start(VoiceAudioIo::Kind::Call, 42)); |
|
|
|
|
await([] { return pulls.load() >= 2; }); |
|
|
|
|
REQUIRE(output_position == 0); |
|
|
|
|
voice.mix(partial, 240, now_us() + 500000, true); |
|
|
|
|
await([] { return output_position.load() == 240; }); |
|
|
|
|
REQUIRE(output_delay > 4500); |
|
|
|
|
voice.mix(partial, 720, now_us(), true); |
|
|
|
|
await([] { return output_position.load() == 960; }); |
|
|
|
|
voice.stop(); |
|
|
|
|
voice.start(VoiceAudioIo::Kind::Call, 42); REQUIRE(voice.startCapture(1, false)); |
|
|
|
|
voice.capture(pcm.data(), 960, now_us() - 300000); // Backend latency не является возрастом worker-очереди.
|
|
|
|
|
int64_t capturePts = now_us() - 300000; |
|
|
|
|
voice.capture(pcm.data(), 960, capturePts); // Backend latency не является возрастом worker-очереди.
|
|
|
|
|
await([] { return blocks.load() == 1; }); voice.stopCapture(); voice.stop(); |
|
|
|
|
REQUIRE(capture.size() == 960); reset(); |
|
|
|
|
REQUIRE(capture.size() == 960 && capture_time == capturePts); reset(); |
|
|
|
|
// Референс противофазный: mono downmix дал бы ноль и не смог подавить эхо.
|
|
|
|
|
voice.start(VoiceAudioIo::Kind::Call, 43); REQUIRE(voice.startCapture(1, true)); |
|
|
|
|
uint32_t rng = 1234567; |
|
|
|
|
|