Skip to content

Commit

Permalink
Added windows arm64 libs
Browse files Browse the repository at this point in the history
  • Loading branch information
matt200-ok committed Jan 9, 2025
1 parent 88c8440 commit 4bfbc57
Show file tree
Hide file tree
Showing 35 changed files with 142 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ body:
- Web (WASM)
- Linux (x86_64)
- macOS (x86_64, arm64)
- Windows (x86_64)
- Windows (x86_64, arm64)
- Raspberry Pi
validations:
required: true
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/c-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ jobs:
- os: windows-latest
platform: windows
arch: amd64
- os: windows-latest
platform: windows
arch: arm64
make_file: "MinGW Makefiles"
- os: macos-latest
platform: mac
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/dotnet-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: windows-latest
platform: windows
arch: amd64
- os: windows-latest
platform: windows
arch: arm64

steps:
- uses: actions/checkout@v3
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ jobs:
os: [ubuntu-latest, macos-latest, macos-13, windows-latest]
dotnet-version: [2.1.x, 3.0.x, 3.1.x, 5.0.x, 6.0.x, 8.0.x]
include:
- os: windows-latest
platform: windows
arch: amd64
- os: windows-latest
platform: windows
arch: arm64
- dotnet-version: 2.1.x
binding-framework: netstandard2.0
test-framework: netcoreapp2.1
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/java-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
java-version: ['11', '17', '19']
include:
- os: windows-latest
platform: windows
arch: amd64
- os: windows-latest
platform: windows
arch: arm64

steps:
- uses: actions/checkout@v3
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
java-version: ['11', '17', '19']
include:
- os: windows-latest
platform: windows
arch: amd64
- os: windows-latest
platform: windows
arch: arm64

steps:
- uses: actions/checkout@v3
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/nodejs-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [16.x, 18.x, 20.x]
include:
- os: windows-latest
platform: windows
arch: amd64
- os: windows-latest
platform: windows
arch: arm64

steps:
- uses: actions/checkout@v3
Expand All @@ -39,6 +46,14 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

# ************ REMOVE AFTER RELEASE ***************
- name: build local binding
run: |
yarn install
yarn build
working-directory: binding/nodejs
# ************ REMOVE AFTER RELEASE ***************

- name: Install dependencies
run: yarn install

Expand All @@ -55,6 +70,14 @@ jobs:
steps:
- uses: actions/checkout@v3

# ************ REMOVE AFTER RELEASE ***************
- name: build local binding
run: |
yarn install
yarn build
working-directory: binding/nodejs
# ************ REMOVE AFTER RELEASE ***************

- name: Install dependencies
run: yarn install

Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [16.x, 18.x, 20.x]
include:
- os: windows-latest
platform: windows
arch: amd64
- os: windows-latest
platform: windows
arch: arm64

steps:
- uses: actions/checkout@v3
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/python-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
include:
- os: windows-latest
platform: windows
arch: amd64
- os: windows-latest
platform: windows
arch: arm64

steps:
- uses: actions/checkout@v3
Expand All @@ -36,6 +43,14 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

# ************ REMOVE AFTER RELEASE ***************
- name: build local binding
run: |
python3 -m pip install setuptools wheel
python3 -m setup sdist bdist_wheel
working-directory: binding/python
# ************ REMOVE AFTER RELEASE ***************

- name: Pre-build dependencies
run: python -m pip install --upgrade pip

Expand All @@ -55,6 +70,14 @@ jobs:
steps:
- uses: actions/checkout@v3

# ************ REMOVE AFTER RELEASE ***************
- name: build local binding
run: |
python3 -m pip install setuptools wheel
python3 -m setup sdist bdist_wheel
working-directory: binding/python
# ************ REMOVE AFTER RELEASE ***************

- name: Install dependencies
run: pip3 install -r requirements.txt

Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
include:
- os: windows-latest
platform: windows
arch: amd64
- os: windows-latest
platform: windows
arch: arm64

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Cheetah is an on-device streaming speech-to-text engine. Cheetah is:
- [Accurate](https://picovoice.ai/docs/benchmark/stt/)
- [Compact and Computationally-Efficient](https://github.com/Picovoice/speech-to-text-benchmark#rtf)
- Cross-Platform:
- Linux (x86_64), macOS (x86_64, arm64), and Windows (x86_64)
- Linux (x86_64), macOS (x86_64, arm64), and Windows (x86_64, arm64)
- Android and iOS
- Chrome, Safari, Firefox, and Edge
- Raspberry Pi (3, 4, 5)
Expand Down
4 changes: 2 additions & 2 deletions binding/dotnet/Cheetah/Cheetah.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net6.0;netcoreapp3.0;netstandard2.0;</TargetFrameworks>
<Version>2.1.0</Version>
<Version>2.1.1</Version>
<Authors>Picovoice</Authors>
<Company />
<Product>Cheetah Speech-to-Text Engine</Product>
Expand All @@ -18,7 +18,7 @@
- Private; All voice processing runs locally.
- Accurate
- Compact and Computationally-Efficient
- Cross-Platform: Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64), Raspberry Pi (3, 4, 5)
- Cross-Platform: Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64, arm64), Raspberry Pi (3, 4, 5)
</Description>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageIcon>pv_circle_512.png</PackageIcon>
Expand Down
4 changes: 4 additions & 0 deletions binding/dotnet/Cheetah/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ public static string PvLibraryPath(string libName)
{
return Path.Combine(AppContext.BaseDirectory, $"lib/{_env}/amd64/{libName}.dll");
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && _arch == Architecture.Arm64)
{
return Path.Combine(AppContext.BaseDirectory, $"lib/{_env}/arm64/{libName}.dll");
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) && _arch == Architecture.X64)
{
return Path.Combine(AppContext.BaseDirectory, $"lib/{_env}/x86_64/{libName}.dylib");
Expand Down
6 changes: 3 additions & 3 deletions binding/dotnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Cheetah is an on-device streaming speech-to-text engine. Cheetah is:
- [Accurate](https://picovoice.ai/docs/benchmark/stt/#results)
- [Compact and Computationally-Efficient](https://github.com/Picovoice/speech-to-text-benchmark#rtf)
- Cross-Platform:
- Linux (x86_64), macOS (x86_64, arm64), and Windows (x86_64)
- Linux (x86_64), macOS (x86_64, arm64), and Windows (x86_64, arm64)
- Android and iOS
- Chrome, Safari, Firefox, and Edge
- Raspberry Pi (3, 4, 5)
Expand All @@ -23,13 +23,13 @@ Cheetah is an on-device streaming speech-to-text engine. Cheetah is:

Platform compatible with .NET Framework 4.6.1+:

- Windows (x86_64)
- Windows (x86_64, arm64)

Platforms compatible with .NET Core 2.0+:

- Linux (x86_64)
- macOS (x86_64)
- Windows (x86_64)
- Windows (x86_64, arm64)

Platforms compatible with .NET Core 3.0+:

Expand Down
2 changes: 1 addition & 1 deletion binding/java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Cheetah is an on-device speech-to-text engine. Cheetah is:
- [Accurate](https://picovoice.ai/docs/benchmark/stt/)
- [Compact and Computationally-Efficient](https://github.com/Picovoice/speech-to-text-benchmark#rtf)
- Cross-Platform:
- Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64)
- Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64, arm64)
- Android and iOS
- Chrome, Safari, Firefox, and Edge
- Raspberry Pi (3, 4, 5)
Expand Down
2 changes: 1 addition & 1 deletion binding/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {

ext {
PUBLISH_GROUP_ID = 'ai.picovoice'
PUBLISH_VERSION = '2.1.0'
PUBLISH_VERSION = '2.1.1'
PUBLISH_ARTIFACT_ID = 'cheetah-java'
}

Expand Down
6 changes: 5 additions & 1 deletion binding/java/src/ai/picovoice/cheetah/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ private static String getArchitecture() throws RuntimeException {
} else if (ENVIRONMENT_NAME.equals("windows")) {
if (isX86_64) {
return "amd64";
} else if (isArm) {
return "arm64";
}
} else if (ENVIRONMENT_NAME.equals("linux")) {
if (isX86_64) {
Expand Down Expand Up @@ -215,7 +217,9 @@ public static String getPackagedModelPath() {
public static String getPackagedLibraryPath() {
switch (ENVIRONMENT_NAME) {
case "windows":
return RESOURCE_DIRECTORY.resolve("lib/java/windows/amd64/libpv_cheetah_jni.dll").toString();
return RESOURCE_DIRECTORY.resolve("lib/java/windows")
.resolve(ARCHITECTURE)
.resolve("libpv_cheetah_jni.dll").toString();
case "mac":
return RESOURCE_DIRECTORY.resolve("lib/java/mac")
.resolve(ARCHITECTURE)
Expand Down
4 changes: 2 additions & 2 deletions binding/nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ Cheetah is an on-device streaming speech-to-text engine. Cheetah is:
- Accurate [[1]](https://picovoice.ai/docs/benchmark/stt/#results)
- Compact and Computationally-Efficient [[2]](https://github.com/Picovoice/speech-to-text-benchmark#rtf)
- Cross-Platform:
- Linux (x86_64), macOS (x86_64, arm64), and Windows (x86_64)
- Linux (x86_64), macOS (x86_64, arm64), and Windows (x86_64, arm64)
- Android and iOS
- Chrome, Safari, Firefox, and Edge
- Raspberry Pi (3, 4, 5)

## Compatibility

- Node.js 16+
- Runs on Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64), and Raspberry Pi (3, 4, 5).
- Runs on Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64, arm64), and Raspberry Pi (3, 4, 5).

## Installation

Expand Down
2 changes: 1 addition & 1 deletion binding/nodejs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@picovoice/cheetah-node",
"version": "2.1.0",
"version": "2.1.1",
"description": "Picovoice Cheetah Node.js binding",
"main": "dist/index.js",
"types": "dist/types/index.d.ts",
Expand Down
10 changes: 7 additions & 3 deletions binding/nodejs/src/platforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ SYSTEM_TO_LIBRARY_PATH.set(
`${SYSTEM_WINDOWS}/${X86_64}`,
`${PLATFORM_WINDOWS}/amd64/pv_cheetah.node`
);
SYSTEM_TO_LIBRARY_PATH.set(
`${SYSTEM_WINDOWS}/${ARM_64}`,
`${PLATFORM_WINDOWS}/arm64/pv_picollm.node`
);

function absoluteLibraryPath(libraryPath: string): string {
return path.resolve(__dirname, LIBRARY_PATH_PREFIX, libraryPath);
Expand Down Expand Up @@ -137,7 +141,7 @@ export function getPlatform(): string {
return PLATFORM_MAC;
}

if (system === SYSTEM_WINDOWS && arch === X86_64) {
if (system === SYSTEM_WINDOWS && (arch === X86_64 || arch === ARM_64)) {
return PLATFORM_WINDOWS;
}

Expand Down Expand Up @@ -188,9 +192,9 @@ export function getSystemLibraryPath(): string {
break;
}
case SYSTEM_WINDOWS: {
if (arch === X86_64) {
if (arch === X86_64 || arch === ARM_64) {
return absoluteLibraryPath(
SYSTEM_TO_LIBRARY_PATH.get(`${SYSTEM_WINDOWS}/${X86_64}`)
SYSTEM_TO_LIBRARY_PATH.get(`${SYSTEM_WINDOWS}/${arch}`)
);
}
break;
Expand Down
4 changes: 2 additions & 2 deletions binding/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ Cheetah is an on-device streaming speech-to-text engine. Cheetah is:
- [Accurate](https://picovoice.ai/docs/benchmark/stt/)
- [Compact and Computationally-Efficient](https://github.com/Picovoice/speech-to-text-benchmark#rtf)
- Cross-Platform:
- Linux (x86_64), macOS (x86_64, arm64), and Windows (x86_64)
- Linux (x86_64), macOS (x86_64, arm64), and Windows (x86_64, arm64)
- Android and iOS
- Chrome, Safari, Firefox, and Edge
- Raspberry Pi (3, 4, 5)

## Compatibility

- Python 3.8+
- Runs on Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64), and Raspberry Pi (3, 4, 5).
- Runs on Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64, arm64), and Raspberry Pi (3, 4, 5).

## Installation

Expand Down
5 changes: 4 additions & 1 deletion binding/python/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ def default_library_path(relative):
relative,
'lib/raspberry-pi/%s/libpv_cheetah.so' % linux_machine)
elif platform.system() == 'Windows':
return os.path.join(os.path.dirname(__file__), relative, 'lib/windows/amd64/libpv_cheetah.dll')
if platform.machine().lower() == 'amd64':
return os.path.join(os.path.dirname(__file__), relative, 'lib/windows/amd64/libpv_cheetah.dll')
elif platform.machine().lower() == 'arm64':
return os.path.join(os.path.dirname(__file__), relative, 'lib/windows/arm64/libpv_cheetah.dll')

raise NotImplementedError('Unsupported platform.')

Expand Down
2 changes: 1 addition & 1 deletion binding/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

setuptools.setup(
name="pvcheetah",
version="2.1.0",
version="2.1.1",
author="Picovoice",
author_email="hello@picovoice.ai",
description="Cheetah Speech-to-Text Engine.",
Expand Down
2 changes: 1 addition & 1 deletion demo/dotnet/CheetahDemo/CheetahDemo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Picovoice.Cheetah" Version="2.1.0" />
<ProjectReference Include="..\..\..\binding\dotnet\Cheetah\Cheetah.csproj" />
<PackageReference Include="PvRecorder" Version="1.2.6" />
</ItemGroup>
</Project>
Loading

0 comments on commit 4bfbc57

Please sign in to comment.