You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to launch commands with my voice using picovoice porcupine. On discord desktop the wakeword is not detected but on the mobile app it is. I tried recording the audio and the audio recorded from the mobile app is perfectly clear while the audio from the desktop app is distorted.
What version of the library are you using?
v4.4.6 (Stable)
What .NET version are you using? Make sure to use the latest patch release for your major version.
.NET 6.0
Operating System
No response
Reproduction Steps
public async Task ReceiveHandler(VoiceNextConnection _, VoiceReceiveEventArgs args)
{
short[] frame = new short[porcupine.FrameLength];
byte[] pcmData = args.PcmData.ToArray();
short[] audioFrame = new short[pcmData.Length / sizeof(short)];
Buffer.BlockCopy(pcmData, 0, audioFrame, 0, pcmData.Length);
if (audioFrame.Length > porcupine.FrameLength)
{
int offset = audioFrame.Length - porcupine.FrameLength;
for (int i = 0; i + porcupine.FrameLength <= audioFrame.Length; i += offset)
{
Array.Copy(audioFrame, i, frame, 0, porcupine.FrameLength);
}
}
else
{
for (int i = 0; i < audioFrame.Length; i += porcupine.FrameLength)
{
int remaining = audioFrame.Length - i;
Array.Copy(audioFrame, i, frame, 0, Math.Min(remaining, porcupine.FrameLength));
if (remaining < porcupine.FrameLength)
{
for (int j = remaining; j < porcupine.FrameLength; j++)
{
frame[j] = 0;
}
}
}
}
if (porcupine != null)
{
int keywordIndex = porcupine.Process(frame);
if (keywordIndex >= 0)
{
await commandRoulette.RouletteStrat(commandContext);
}
}
await Task.Yield();
}
Trace Logs
No response
Exceptions or other error messages
No response
Anything else you'd like to share
No response
The text was updated successfully, but these errors were encountered:
Summary
I want to launch commands with my voice using picovoice porcupine. On discord desktop the wakeword is not detected but on the mobile app it is. I tried recording the audio and the audio recorded from the mobile app is perfectly clear while the audio from the desktop app is distorted.
What version of the library are you using?
v4.4.6 (Stable)
What .NET version are you using? Make sure to use the latest patch release for your major version.
.NET 6.0
Operating System
No response
Reproduction Steps
Trace Logs
No response
Exceptions or other error messages
No response
Anything else you'd like to share
No response
The text was updated successfully, but these errors were encountered: