Skip to content

Commit 8127a49

Browse files
committed
Deprecate the Picovoice Golang package & certain MCU platforms
1 parent d0f65f7 commit 8127a49

File tree

342 files changed

+3
-370506
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

342 files changed

+3
-370506
lines changed

.github/workflows/go-codestyle.yml

-63
This file was deleted.

.github/workflows/go-demos.yml

-65
This file was deleted.

.github/workflows/go.yml

-89
This file was deleted.

README.md

+1-107
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
[![PyPI](https://img.shields.io/pypi/v/picovoice)](https://pypi.org/project/picovoice/)
88
[![Nuget](https://img.shields.io/nuget/v/picovoice)](https://www.nuget.org/packages/Picovoice/)
9-
[![Go Reference](https://pkg.go.dev/badge/github.com/Picovoice/picovoice/sdk/go/v2.svg)](https://pkg.go.dev/github.com/Picovoice/picovoice/sdk/go/v2)
109
[![Pub Version](https://img.shields.io/pub/v/picovoice_flutter)](https://pub.dev/packages/picovoice_flutter)
1110
[![npm](https://img.shields.io/npm/v/@picovoice/picovoice-react-native?label=npm%20%5Breact-native%5D)](https://www.npmjs.com/package/@picovoice/picovoice-react-native)
1211
[![Maven Central](https://img.shields.io/maven-central/v/ai.picovoice/picovoice-android?label=maven%20central%20%5Bandroid%5D)](https://repo1.maven.org/maven2/ai/picovoice/picovoice-android/)
@@ -48,7 +47,7 @@ spoken command:
4847
- **Private & Secure:** Everything is processed offline. Intrinsically private; HIPAA and GDPR-compliant.
4948
- **Accurate:** Resilient to noise and reverberation. Outperforms cloud-based alternatives by wide margins.
5049
- **Cross-Platform:** Design once, deploy anywhere. Build using familiar languages and frameworks.
51-
- Arm Cortex-M, STM32, Arduino, and i.MX RT
50+
- Arm Cortex-M, STM32, and Arduino
5251
- Raspberry Pi (Zero, 3, 4, 5)
5352
- Android and iOS
5453
- Chrome, Safari, Firefox, and Edge
@@ -106,7 +105,6 @@ platform.
106105
- [NodeJS](#nodejs-demos)
107106
- [.NET](#net-demos)
108107
- [Java](#java-demos)
109-
- [Go](#go-demos)
110108
- [Unity](#unity-demos)
111109
- [Flutter](#flutter-demos)
112110
- [React Native](#react-native-demos)
@@ -123,7 +121,6 @@ platform.
123121
- [NodeJS](#nodejs)
124122
- [.NET](#net)
125123
- [Java](#java)
126-
- [Go](#go)
127124
- [Unity](#unity)
128125
- [Flutter](#flutter)
129126
- [React Native](#react-native)
@@ -322,39 +319,6 @@ Upon success the following it printed into the terminal:
322319

323320
For more information about the Java demos go to [demo/java](demo/java/README.md).
324321

325-
### Go Demos
326-
327-
The demos require `cgo`, which means that a gcc compiler like [Mingw](https://www.mingw-w64.org/) is required.
328-
329-
From [demo/go](demo/go) run the following command from the terminal to build and run the mic demo:
330-
```console
331-
go run micdemo/picovoice_mic_demo.go \
332-
-access_key ${ACCESS_KEY} \
333-
-keyword_path "../../resources/porcupine/resources/keyword_files/${PLATFORM}/porcupine_${PLATFORM}.ppn" \
334-
-context_path "../../resources/rhino/resources/contexts/${PLATFORM}/smart_lighting_${PLATFORM}.rhn"
335-
```
336-
337-
Replace `${PLATFORM}` with the platform you are running the demo on (e.g. `linux`, `mac`, or `windows`). The microphone
338-
demo opens an audio stream from the microphone, detects utterances of a given wake phrase, and infers intent from the
339-
follow-on spoken command. Once the demo initializes, it prints `Listening ...` to the console. Then say:
340-
341-
> Porcupine, set the lights in the kitchen to orange.
342-
343-
Upon success the following it printed into the terminal:
344-
345-
```text
346-
[wake word]
347-
{
348-
intent : 'changeColor'
349-
slots : {
350-
location : 'kitchen'
351-
color : 'orange'
352-
}
353-
}
354-
```
355-
356-
For more information about the Go demos go to [demo/go](demo/go/README.md).
357-
358322
### Unity Demos
359323

360324
To run the Picovoice Unity demo, import the latest [Picovoice Unity package](sdk/unity) into your project, open the PicovoiceDemo scene and hit play. To run on other platforms or in the player, go to _File > Build Settings_, choose your platform and hit the `Build and Run` button.
@@ -878,76 +842,6 @@ Once you're done with Picovoice, ensure you release its resources explicitly:
878842
handle.delete();
879843
```
880844

881-
### Go
882-
883-
To install the Picovoice Go module to your project, use the command:
884-
```console
885-
go get github.com/Picovoice/picovoice/sdk/go
886-
```
887-
888-
To create an instance of the engine with default parameters, use the `NewPicovoice` function. You must provide a Porcupine keyword file, a wake word detection callback function, a Rhino context file and an inference callback function. You must then make a call to `Init()`.
889-
890-
```go
891-
. "github.com/Picovoice/picovoice/sdk/go/v2"
892-
rhn "github.com/Picovoice/rhino/binding/go/v2"
893-
894-
const accessKey string = "${ACCESS_KEY}" // obtained from Picovoice Console (https://console.picovoice.ai/)
895-
896-
keywordPath := "/path/to/keyword/file.ppn"
897-
wakeWordCallback := func() {
898-
// let user know wake word detected
899-
}
900-
901-
contextPath := "/path/to/keyword/file.rhn"
902-
inferenceCallback := func(inference rhn.RhinoInference) {
903-
if inference.IsUnderstood {
904-
intent := inference.Intent
905-
slots := inference.Slots
906-
// add code to take action based on inferred intent and slot values
907-
} else {
908-
// add code to handle unsupported commands
909-
}
910-
}
911-
912-
picovoice := NewPicovoice(
913-
accessKey,
914-
keywordPath,
915-
wakeWordCallback,
916-
contextPath,
917-
inferenceCallback)
918-
919-
err := picovoice.Init()
920-
if err != nil {
921-
// handle error
922-
}
923-
```
924-
925-
Upon detection of wake word defined by `keywordPath` it starts inferring user's intent from the follow-on voice command within
926-
the context defined by the file located at `contextPath`. `accessKey` is your Picovoice `AccessKey`. `keywordPath` is the absolute path to
927-
[Porcupine wake word engine](https://github.com/Picovoice/porcupine) keyword file (with `.ppn` suffix).
928-
`contextPath` is the absolute path to [Rhino Speech-to-Intent engine](https://github.com/Picovoice/rhino) context file
929-
(with `.rhn` suffix). `wakeWordCallback` is invoked upon the detection of wake phrase and `inferenceCallback` is
930-
invoked upon completion of follow-on voice command inference.
931-
932-
When instantiated, valid sample rate can be obtained via `SampleRate`. Expected number of audio samples per
933-
frame is `FrameLength`. The engine accepts 16-bit linearly-encoded PCM and operates on single-channel audio.
934-
935-
```go
936-
func getNextFrameAudio() []int16 {
937-
// get audio frame
938-
}
939-
940-
for {
941-
err := picovoice.Process(getNextFrameAudio())
942-
}
943-
```
944-
945-
When done resources have to be released explicitly
946-
947-
```go
948-
picovoice.Delete()
949-
```
950-
951845
### Unity
952846

953847
Import the latest [Picovoice Unity Package](sdk/unity) into your Unity project.

0 commit comments

Comments
 (0)