forked from Manuel/meeting-assistant
feat: add local Resemblyzer speaker recognition
This commit is contained in:
@@ -809,6 +809,32 @@ public sealed class WorkflowRulesEditorTests
|
||||
Assert.Empty(await fixture.Context.SpeakerIdentities.ToListAsync());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task RulesEditorToolsExposeVoiceVectorCountsSeparatelyFromWavSamples()
|
||||
{
|
||||
await using var fixture = await WorkflowRulesEditorIdentityFixture.CreateAsync();
|
||||
var identity = await fixture.AddIdentityAsync("Sabrina", sample: [1, 2, 3]);
|
||||
fixture.Context.SpeakerVoiceVectors.Add(new SpeakerVoiceVector
|
||||
{
|
||||
SpeakerIdentityId = identity.Id,
|
||||
ModelId = "resemblyzer-0.1.4-pretrained",
|
||||
Dimensions = 256,
|
||||
VectorBytes = new byte[256 * sizeof(float)],
|
||||
Fingerprint = "vector-1",
|
||||
CreatedAt = DateTimeOffset.UtcNow
|
||||
});
|
||||
await fixture.Context.SaveChangesAsync();
|
||||
var tools = fixture.CreateTools();
|
||||
|
||||
var searchResult = await tools.SearchIdentities("Sabrina");
|
||||
var readResult = await tools.ReadIdentity(identity.Id);
|
||||
|
||||
Assert.Contains("\"sampleCount\": 1", searchResult);
|
||||
Assert.Contains("\"voiceVectorCount\": 1", searchResult);
|
||||
Assert.Contains("\"voiceVectorCount\": 1", readResult);
|
||||
Assert.DoesNotContain("vector-1", readResult);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task RulesEditorToolsRefusesSamplelessSpeakerIdentityCreation()
|
||||
{
|
||||
@@ -817,7 +843,7 @@ public sealed class WorkflowRulesEditorTests
|
||||
|
||||
var result = await tools.CreateIdentity("Sabrina", ["Sabi"], ["Guest-01"]);
|
||||
|
||||
Assert.StartsWith("Refused: speaker identities require at least one audio sample.", result);
|
||||
Assert.StartsWith("Refused: speaker identities require audio evidence", result);
|
||||
Assert.Empty(await fixture.Context.SpeakerIdentities.ToListAsync());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user