Porcupine 1.9.0
Porcupine is a highly-accurate and lightweight wake word engine. It enables building always-listening voice-enabled applications.
Porcupine is:
- using deep neural networks trained in real-world environments.
- compact and computationally-efficient making it perfect for IoT.
- scalable. It can detect multiple always-listening voice commands
with no added CPU/memory footprint.
- self-service. Developers can train custom wake phrases using Picovoice Console.
Install-Package Porcupine -Version 1.9.0
dotnet add package Porcupine --version 1.9.0
<PackageReference Include="Porcupine" Version="1.9.0" />
paket add Porcupine --version 1.9.0
Porcupine Wake Word Engine
Made in Vancouver, Canada by Picovoice
Porcupine is a highly-accurate and lightweight wake word engine. It enables building always-listening voice-enabled
applications.
Porcupine is:
- using deep neural networks trained in real-world environments.
- compact and computationally-efficient. It is perfect for IoT.
- scalable. It can detect multiple always-listening voice commands with no added runtime footprint.
- self-service. Developers can train custom wake word models using Picovoice Console.
Compatibility
- .NET Standard 2.0, .NET Core 2.0+, .NET Framework 4.6.1+
- Runs on Linux (x86_64), macOS (x86_64) and Windows (x86_64)
Installation
You can install the latest version of Porcupine by getting the latest Porcupine Nuget package
in Visual Studio or using the .NET CLI.
dotnet add package Porcupine
Usage
Create an instance of the engine
using Pv;
Porcupine handle = Porcupine.Create(keywords: new List<string> { "picovoice" });
handle
is an instance of Porcupine that detects utterances of "Picovoice". The keywords
input argument is a shorthand
for accessing default keyword model files shipped with the package. The list of default keywords can be retrieved by
using Pv;
foreach (string keyword in Porcupine.KEYWORDS)
{
Console.WriteLine(keyword);
}
Porcupine can detect multiple keywords concurrently
using Pv;
Porcupine handle = Porcupine.Create(keywords: new List<string>{ "bumblebee", "picovoice" });
To detect non-default keywords use the keywordPaths
input argument instead
using Pv;
var keywordPaths = new List<string>{ "/absolute/path/to/keyword/one", "/absolute/path/to/keyword/two", ...}
Porcupine handle = Porcupine.Create(keywordPaths: keywordPaths);
The sensitivity of the engine can be tuned per-keyword using the sensitivities
input argument
using Pv;
Porcupine handle = Porcupine.Create(keywords: new List<string>{ "grapefruit", "porcupine" },
sensitivities: new List<float>{ 0.6f, 0.35f });
Sensitivity is the parameter that enables trading miss rate for the false alarm rate. It is a floating point number within
[0, 1]
. A higher sensitivity reduces the miss rate at the cost of increased false alarm rate.
When initialized, the valid sample rate is given by handle.SampleRate
. Expected frame length (number of audio samples
in an input array) is handle.FrameLength
. The engine accepts 16-bit linearly-encoded PCM and operates on
single-channel audio.
short[] GetNextAudioFrame()
{
// .. get audioFrame
return audioFrame;
}
while(true)
{
var keywordIndex = handle.Process(GetNextAudioFrame());
if(keywordIndex >= 0)
{
// .. detection event logic/callback
}
}
Porcupine will have its resources freed by the garbage collector, but to have resources freed immediately after use,
wrap it in a using statement:
using(Porcupine handle = Porcupine.Create(keywords: new List<string> { "picovoice" }))
{
// .. Porcupine usage here
}
Demos
The Porcupine dotnet demo project is a .NET Core command line application that allows for
processing real-time audio (i.e. microphone) and files using Porcupine.
Porcupine Wake Word Engine
Made in Vancouver, Canada by Picovoice
Porcupine is a highly-accurate and lightweight wake word engine. It enables building always-listening voice-enabled
applications.
Porcupine is:
- using deep neural networks trained in real-world environments.
- compact and computationally-efficient. It is perfect for IoT.
- scalable. It can detect multiple always-listening voice commands with no added runtime footprint.
- self-service. Developers can train custom wake word models using Picovoice Console.
Compatibility
- .NET Standard 2.0, .NET Core 2.0+, .NET Framework 4.6.1+
- Runs on Linux (x86_64), macOS (x86_64) and Windows (x86_64)
Installation
You can install the latest version of Porcupine by getting the latest Porcupine Nuget package
in Visual Studio or using the .NET CLI.
dotnet add package Porcupine
Usage
Create an instance of the engine
using Pv;
Porcupine handle = Porcupine.Create(keywords: new List<string> { "picovoice" });
handle
is an instance of Porcupine that detects utterances of "Picovoice". The keywords
input argument is a shorthand
for accessing default keyword model files shipped with the package. The list of default keywords can be retrieved by
using Pv;
foreach (string keyword in Porcupine.KEYWORDS)
{
Console.WriteLine(keyword);
}
Porcupine can detect multiple keywords concurrently
using Pv;
Porcupine handle = Porcupine.Create(keywords: new List<string>{ "bumblebee", "picovoice" });
To detect non-default keywords use the keywordPaths
input argument instead
using Pv;
var keywordPaths = new List<string>{ "/absolute/path/to/keyword/one", "/absolute/path/to/keyword/two", ...}
Porcupine handle = Porcupine.Create(keywordPaths: keywordPaths);
The sensitivity of the engine can be tuned per-keyword using the sensitivities
input argument
using Pv;
Porcupine handle = Porcupine.Create(keywords: new List<string>{ "grapefruit", "porcupine" },
sensitivities: new List<float>{ 0.6f, 0.35f });
Sensitivity is the parameter that enables trading miss rate for the false alarm rate. It is a floating point number within
[0, 1]
. A higher sensitivity reduces the miss rate at the cost of increased false alarm rate.
When initialized, the valid sample rate is given by handle.SampleRate
. Expected frame length (number of audio samples
in an input array) is handle.FrameLength
. The engine accepts 16-bit linearly-encoded PCM and operates on
single-channel audio.
short[] GetNextAudioFrame()
{
// .. get audioFrame
return audioFrame;
}
while(true)
{
var keywordIndex = handle.Process(GetNextAudioFrame());
if(keywordIndex >= 0)
{
// .. detection event logic/callback
}
}
Porcupine will have its resources freed by the garbage collector, but to have resources freed immediately after use,
wrap it in a using statement:
using(Porcupine handle = Porcupine.Create(keywords: new List<string> { "picovoice" }))
{
// .. Porcupine usage here
}
Demos
The Porcupine dotnet demo project is a .NET Core command line application that allows for
processing real-time audio (i.e. microphone) and files using Porcupine.
Release Notes
See https://github.com/Picovoice/porcupine/
Dependencies
-
.NETStandard 2.0
- No dependencies.
Used By
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Porcupine:
Package | Downloads |
---|---|
Picovoice
Picovoice is an end-to-end platform for building voice products on your terms. It enables creating voice experiences similar to Alexa and Google. But it entirely runs 100% on-device.
Picovoice is:
- Private: Everything is processed offline. Intrinsically HIPAA and GDPR compliant.
- Reliable: Runs without needing constant connectivity.
- Zero Latency: Edge-first architecture eliminates unpredictable network delay.
- Accurate: Resilient to noise and reverberation. It outperforms cloud-based alternatives by wide margins *.
- Cross-Platform: Design once, deploy anywhere. Build using familiar languages and frameworks.
|
GitHub repositories
This package is not used by any popular GitHub repositories.