Make meeting lifecycle stateful

This commit is contained in:
2026-05-27 12:55:17 +02:00
parent d607b957bb
commit e85274829a
91 changed files with 4076 additions and 479 deletions
@@ -100,7 +100,27 @@ public sealed class AzureSpeechSpeakerIdentityMatcherTests
Assert.Null(match);
}
private static AzureSpeechSpeakerIdentityMatcher CreateMatcher(ISpeakerIdentityDiarizationClient diarizationClient)
[Fact]
public async Task MatcherReturnsNullWhenDiarizationTimesOut()
{
var matcher = CreateMatcher(
new HangingSpeakerIdentityDiarizationClient(),
TimeSpan.FromMilliseconds(20));
var snippet = CreateWavSnippet();
var match = await matcher.MatchAsync(
new SpeakerIdentityMatchRequest(
"Guest03",
snippet,
[new SpeakerIdentityMatchCandidate(42, "Chris", 5, [snippet])]),
CancellationToken.None);
Assert.Null(match);
}
private static AzureSpeechSpeakerIdentityMatcher CreateMatcher(
ISpeakerIdentityDiarizationClient diarizationClient,
TimeSpan? matchTimeout = null)
{
return new AzureSpeechSpeakerIdentityMatcher(
diarizationClient,
@@ -108,7 +128,8 @@ public sealed class AzureSpeechSpeakerIdentityMatcherTests
{
SpeakerIdentification = new SpeakerIdentificationOptions
{
SilenceBetweenSnippetsSeconds = 1
SilenceBetweenSnippetsSeconds = 1,
MatchTimeout = matchTimeout ?? TimeSpan.FromMinutes(1)
}
}),
NullLogger<AzureSpeechSpeakerIdentityMatcher>.Instance);
@@ -145,4 +166,15 @@ public sealed class AzureSpeechSpeakerIdentityMatcherTests
return Task.FromResult(segments);
}
}
private sealed class HangingSpeakerIdentityDiarizationClient : ISpeakerIdentityDiarizationClient
{
public async Task<IReadOnlyList<TranscriptionSegment>> DiarizeAsync(
string wavPath,
CancellationToken cancellationToken)
{
await Task.Delay(Timeout.InfiniteTimeSpan, cancellationToken);
return [];
}
}
}