Skip to content

Commit

Permalink
Go rpi5 support (#1220)
Browse files Browse the repository at this point in the history
  • Loading branch information
laves authored Feb 2, 2024
1 parent fef173d commit 199f349
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 16 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/go-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ ubuntu-latest, windows-latest, macos-latest ]
go: [ '1.16', '1.17', '1.18', '1.19', '1.20', 'stable' ]

steps:
Expand All @@ -45,7 +45,7 @@ jobs:

- name: Build micdemo
run: go build micdemo/porcupine_mic_demo.go

- name: Build filedemo
run: go build filedemo/porcupine_file_demo.go

Expand All @@ -57,14 +57,14 @@ jobs:

strategy:
matrix:
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, jetson]
machine: [rpi2, rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64, jetson ]

steps:
- uses: actions/checkout@v3

- name: Build micdemo
run: go build micdemo/porcupine_mic_demo.go

- name: Build filedemo
run: go build filedemo/porcupine_file_demo.go

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:

strategy:
matrix:
machine: [rpi2, rpi3-32, rpi3-64, rpi4-32, rpi4-64, jetson, beaglebone]
machine: [rpi2, rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64, jetson, beaglebone]

steps:
- uses: actions/checkout@v3
Expand Down
Binary file not shown.
Binary file not shown.
4 changes: 3 additions & 1 deletion binding/go/porcupine.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021-2023 Picovoice Inc.
// Copyright 2021-2024 Picovoice Inc.
//
// You may not use this file except in compliance with the license. A copy of the license is
// located in the "LICENSE" file accompanying this source.
Expand Down Expand Up @@ -402,6 +402,8 @@ func getLinuxDetails() (string, string) {
return "jetson", "cortex-a57" + archInfo
case "0xd08":
return "raspberry-pi", "cortex-a72" + archInfo
case "0xd0b":
return "raspberry-pi", "cortex-a76" + archInfo
case "0xc08":
return "beaglebone", ""
default:
Expand Down
9 changes: 5 additions & 4 deletions demo/go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This Go module contains demos for processing real-time audio (i.e. microphone) a
## Requirements

- go 1.16+
- **Windows**: The demo requires `cgo`, which means that you need to install a gcc compiler like [Mingw](http://mingw-w64.org/) to build it properly.
- **Windows**: The demo requires `cgo`, which means that you need to install a gcc compiler like [Mingw](http://mingw-w64.org/) to build it properly.
- Go versions less than `1.20` requires `gcc` version `11` or lower.

## Compatibility
Expand All @@ -18,6 +18,7 @@ This Go module contains demos for processing real-time audio (i.e. microphone) a
- 2
- 3 (32 and 64 bit)
- 4 (32 and 64 bit)
- 5 (32 and 64 bit)
- NVIDIA Jetson Nano
- BeagleBone

Expand All @@ -37,8 +38,8 @@ porcupine/demo/go

### File Demo

The file demo uses Porcupine to scan for keywords in a wave file. The demo is mainly useful for quantitative performance benchmarking against a corpus of audio data.
Porcupine processes a 16kHz, single-channel audio stream. If a stereo file is provided it only processes the first (left) channel.
The file demo uses Porcupine to scan for keywords in a wave file. The demo is mainly useful for quantitative performance benchmarking against a corpus of audio data.
Porcupine processes a 16kHz, single-channel audio stream. If a stereo file is provided it only processes the first (left) channel.
The following processes a file looking for instances of the phrase "Picovoice":

```console
Expand Down Expand Up @@ -132,7 +133,7 @@ It provides information about various audio input devices on the box. Here is an
```console
index: 0, device name: USB Audio Device
index: 1, device name: MacBook Air Microphone
```
```

You can use the device index to specify which microphone to use for the demo. For instance, if you want to use the USB Audio Device
in the above example, you can invoke the demo application as below:
Expand Down
4 changes: 2 additions & 2 deletions demo/go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module porcupinedemo
go 1.16

require (
github.com/Picovoice/porcupine/binding/go/v3 v3.0.1
github.com/Picovoice/pvrecorder/binding/go v1.2.1
github.com/Picovoice/porcupine/binding/go/v3 v3.0.2
github.com/Picovoice/pvrecorder/binding/go v1.2.2
github.com/go-audio/audio v1.0.0
github.com/go-audio/wav v1.0.0
)
8 changes: 4 additions & 4 deletions demo/go/go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github.com/Picovoice/porcupine/binding/go/v3 v3.0.1 h1:QGLeCljdU5ZAvbYuTD4QPk6E65TRTsS+4ixfZguUVxc=
github.com/Picovoice/porcupine/binding/go/v3 v3.0.1/go.mod h1:6Pg/746wMh0GDNEWqi56GuTsTk7WLeVgTB0ZhyERs8U=
github.com/Picovoice/pvrecorder/binding/go v1.2.1 h1:p99fkYMFbTS4g4WwbhSPkT9PHvlEoVYGaNoqxCITiEo=
github.com/Picovoice/pvrecorder/binding/go v1.2.1/go.mod h1:gQdvBAjoKmRxMFh8W9cVKWcqHsWvu+d13sCPVFm7dhg=
github.com/Picovoice/porcupine/binding/go/v3 v3.0.2 h1:mgvA50lIybYhfCMCwXoPvqjuyAKBppT8ZGSn/7F4ank=
github.com/Picovoice/porcupine/binding/go/v3 v3.0.2/go.mod h1:6Pg/746wMh0GDNEWqi56GuTsTk7WLeVgTB0ZhyERs8U=
github.com/Picovoice/pvrecorder/binding/go v1.2.2 h1:UN0u60hVR+s8kYmVSITS4UbTihHzeNxlNkJKYoKaVbo=
github.com/Picovoice/pvrecorder/binding/go v1.2.2/go.mod h1:gQdvBAjoKmRxMFh8W9cVKWcqHsWvu+d13sCPVFm7dhg=
github.com/go-audio/audio v1.0.0 h1:zS9vebldgbQqktK4H0lUqWrG8P0NxCJVqcj7ZpNnwd4=
github.com/go-audio/audio v1.0.0/go.mod h1:6uAu0+H2lHkwdGsAY+j2wHPNPpPoeg5AaEFh9FlA+Zs=
github.com/go-audio/riff v1.0.0 h1:d8iCGbDvox9BfLagY94fBynxSPHO80LmZCaOsmKxokA=
Expand Down

0 comments on commit 199f349

Please sign in to comment.