-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Description
Hello, could you please tell me what the problem might be? I'm using the nemo_en_titanet_large.onnx model, and about 50% of the time, calling the Sherpa onnx C# API returns a NaN array. This is regardless of the audio length. I'm using 8kHz WAV files. I tried not using Sherpa's built-in resampling, but the result is the same at 16kHz. Examples are attached.
using NAudio.Wave;
using SherpaOnnx;
var config = new SpeakerEmbeddingExtractorConfig
{
Model = @"C:\engine\sv\nemo_en_titanet_large.onnx",
NumThreads = 3,
Debug = 1
};
using var extractor = new SpeakerEmbeddingExtractor(config);
var computed = ComputeEmbedding(@"C:\Users\Артемий\Downloads\VoiceDataset\SR-template-8khz\1_01_03_25.wav");
float[] ComputeEmbedding(string filename)
{
using var reader = new WaveFileReader(filename);
var provider = reader.ToSampleProvider();
using var stream = extractor.CreateStream();
var buffer = new float[4096];
while (provider.Read(buffer, 0, buffer.Length) > 0)
{
stream.AcceptWaveform(reader.WaveFormat.SampleRate, buffer);
}
stream.InputFinished();
return extractor.Compute(stream);
}
Link to example audio: https://transfiles.ru/0avix

Metadata
Metadata
Assignees
Labels
No labels