Skip to content

Commit

Permalink
Go rpi5 support (#679)
Browse files Browse the repository at this point in the history
  • Loading branch information
laves authored Feb 2, 2024
1 parent 8ca8405 commit 9f88096
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 17 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/go-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:

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

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

Expand All @@ -64,7 +64,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]
include:
- machine: rpi2
platform: raspberry-pi
Expand All @@ -76,6 +76,8 @@ jobs:
platform: raspberry-pi
- machine: rpi4-64
platform: raspberry-pi
- machine: rpi5-64
platform: raspberry-pi
- machine: jetson
platform: jetson
- machine: beaglebone
Expand All @@ -86,7 +88,7 @@ jobs:

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

- name: Build filedemo
run: go build filedemo/rhino_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/rhino.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 @@ -510,6 +510,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
13 changes: 7 additions & 6 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.

## Compatibility

Expand All @@ -17,6 +17,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 @@ -36,18 +37,18 @@ cd rhino/demo/go

### File Demo

The file demo uses Rhino to get an inference result from an audio file. This demo is mainly useful for quantitative performance
benchmarking against a corpus of audio data. Note that only the relevant spoken command should be present in the file
The file demo uses Rhino to get an inference result from an audio file. This demo is mainly useful for quantitative performance
benchmarking against a corpus of audio data. Note that only the relevant spoken command should be present in the file
and no other speech. There also needs to be at least one second of silence at the end of the file.

```console
go run filedemo/rhino_file_demo.go \
go run filedemo/rhino_file_demo.go \
-input_audio_path "path/to/input.wav" \
-access_key "${ACCESS_KEY}" \
-context_path "/path/to/context/file.rhn"
```

The sensitivity of the engine can be tuned using the `sensitivity` input argument. You can also override the default Rhino model (.pv), which is required when using a non-English context.
The sensitivity of the engine can be tuned using the `sensitivity` input argument. You can also override the default Rhino model (.pv), which is required when using a non-English context.

```console
go run filedemo/rhino_file_demo.go \
Expand Down Expand Up @@ -81,7 +82,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 rhinodemo
go 1.16

require (
github.com/Picovoice/pvrecorder/binding/go v1.2.1
github.com/Picovoice/rhino/binding/go/v3 v3.0.1
github.com/Picovoice/pvrecorder/binding/go v1.2.2
github.com/Picovoice/rhino/binding/go/v3 v3.0.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/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/rhino/binding/go/v3 v3.0.1 h1:QHoEsIXxJOHFtboUKvLa2DVgsyLsUeO7knZGFgh6Dbo=
github.com/Picovoice/rhino/binding/go/v3 v3.0.1/go.mod h1:CKikI/Tv7hIyj0aOnAKaBIGPzWfx/0SUayYFDnPCmmI=
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/Picovoice/rhino/binding/go/v3 v3.0.2 h1:z3YSRDc2zGJNWkOsqo7aEdW039+VmrqZ8axZ4uOWQDA=
github.com/Picovoice/rhino/binding/go/v3 v3.0.2/go.mod h1:CKikI/Tv7hIyj0aOnAKaBIGPzWfx/0SUayYFDnPCmmI=
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 9f88096

Please sign in to comment.