Skip to content

Commit

Permalink
V1.0 (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
bejager committed Aug 21, 2024
1 parent 45c293f commit 14702c3
Show file tree
Hide file tree
Showing 83 changed files with 253 additions and 234 deletions.
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ voice assistants. Orca is:
- Raspberry Pi (3, 4, 5)
- Chrome, Safari, Firefox, and Edge

**Please note that Orca is currently in development. While we prioritize stability and compatibility, certain aspects of
Orca may undergo changes as we continually enhance and refine the engine to provide the best user experience possible.**

## Table of Contents

- [Orca](#orca)
Expand Down Expand Up @@ -57,15 +54,15 @@ Orca may undergo changes as we continually enhance and refine the engine to prov

## Language Support

- Orca Text-to-Speech currently supports English only.
- Orca Streaming Text-to-Speech currently supports English only.
- Support for [additional languages is available for commercial customers](https://picovoice.ai/consulting/) on a
case-by-case basis.

## Overview

### Orca input and output streaming synthesis

Orca is a text-to-speech engine designed specifically for LLMs. It can process
Orca is a streaming text-to-speech engine designed specifically for LLMs. It can process
incoming text streams in real-time, generating audio continuously, i.e., as the LLM produces tokens,
Orca generates speech in parallel.
This enables seamless conversations with voice assistants, eliminating any audio delays.
Expand All @@ -76,9 +73,9 @@ Orca also supports single synthesis mode, where a complete text is synthesized i

### Text input

Orca accepts the 26 lowercase (a-z) and 26 uppercase (A-Z) letters of the English alphabet, numbers,
basic symbols, as well as common punctuation marks. You can get a list of all supported characters by calling the
`valid_characters()` method provided in the Orca SDK you are using.
Orca supports a wide range of English characters, including letters, numbers, symbols, and punctuation marks.
You can get a list of all supported characters by calling the `valid_characters()` method provided
in the Orca SDK you are using.
Pronunciations of characters or words not supported by this list can be achieved with
[custom pronunciations](#custom-pronunciations).

Expand Down Expand Up @@ -683,6 +680,13 @@ For more details, see the [Node.js SDK](./binding/nodejs/).

## Releases

### v1.0.0 - Aug 20th, 2024

- Improved voice quality
- Significantly reduced latency in streaming synthesis
- Reduced model size
- Advanced text normalization

### v0.2.0 - May 3rd, 2024

- Support for streaming synthesis
Expand Down
4 changes: 2 additions & 2 deletions binding/android/Orca/orca/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'

ext {
PUBLISH_GROUP_ID = 'ai.picovoice'
PUBLISH_VERSION = '0.2.1'
PUBLISH_VERSION = '1.0.0'
PUBLISH_ARTIFACT_ID = 'orca-android'
}

Expand All @@ -15,7 +15,7 @@ android {
minSdkVersion 21
targetSdkVersion defaultTargetSdkVersion
versionCode 2
versionName "0.2.1"
versionName "1.0.0"

consumerProguardFiles "consumer-rules.pro"
}
Expand Down
4 changes: 2 additions & 2 deletions binding/android/OrcaTestApp/orca-test-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'ai.picovoice:orca-android:0.2.1'
implementation 'ai.picovoice:orca-android:1.0.0'

// Espresso UI Testing
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
Expand All @@ -115,7 +115,7 @@ dependencies {
})
androidTestImplementation('com.microsoft.appcenter:espresso-test-extension:1.4')
androidTestImplementation('androidx.test.espresso:espresso-intents:3.5.1')
androidTestImplementation('ai.picovoice:orca-android:0.2.1')
androidTestImplementation('ai.picovoice:orca-android:1.0.0')
}

afterEvaluate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

package ai.picovoice.orca.testapp;

import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
Expand Down
4 changes: 2 additions & 2 deletions binding/ios/Orca-iOS.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = 'Orca-iOS'
s.module_name = 'Orca'
s.version = '0.2.2'
s.version = '1.0.0'
s.license = {:type => 'Apache 2.0'}
s.summary = 'iOS binding for Picovoice\'s Orca Text-to-Speech Engine.'
s.description =
Expand All @@ -18,7 +18,7 @@ Pod::Spec.new do |s|
DESC
s.homepage = 'https://github.com/Picovoice/orca/tree/main/binding/ios'
s.author = { 'Picovoice' => 'hello@picovoice.ai' }
s.source = { :git => "https://github.com/Picovoice/orca.git", :tag => "Orca-iOS-v0.2.2" }
s.source = { :git => "https://github.com/Picovoice/orca.git", :tag => "Orca-iOS-v1.0.0" }
s.ios.deployment_target = '13.0'
s.swift_version = '5.0'
s.vendored_frameworks = 'lib/ios/PvOrca.xcframework'
Expand Down
124 changes: 62 additions & 62 deletions binding/ios/OrcaAppTest/OrcaAppTest.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion binding/ios/OrcaAppTest/OrcaAppTestUITests/BaseTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class BaseTest: XCTestCase {
}

func compareArrays(arr1: [Int16], arr2: [Int16], step: Int) -> Bool {
for i in stride(from: 0, to: arr1.count - step, by: step) where !(abs(arr1[i] - arr2[i]) <= 500) {
for i in stride(from: 0, to: arr1.count - step, by: step) where !(abs(arr1[i] - arr2[i]) <= 12000) {
return false
}
return true
Expand Down
6 changes: 3 additions & 3 deletions binding/ios/OrcaAppTest/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ source 'https://cdn.cocoapods.org/'
platform :ios, '13.0'

target 'OrcaAppTest' do
pod 'Orca-iOS', '~> 0.2.2'
pod 'Orca-iOS', '~> 1.0.0'
end

target 'OrcaAppTestUITests' do
pod 'Orca-iOS', '~> 0.2.2'
pod 'Orca-iOS', '~> 1.0.0'
end

target 'PerformanceTest' do
pod 'Orca-iOS', '~> 0.2.2'
pod 'Orca-iOS', '~> 1.0.0'
end
8 changes: 4 additions & 4 deletions binding/ios/OrcaAppTest/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
PODS:
- Orca-iOS (0.2.2)
- Orca-iOS (1.0.0)

DEPENDENCIES:
- Orca-iOS (~> 0.2.2)
- Orca-iOS (~> 1.0.0)

SPEC REPOS:
trunk:
- Orca-iOS

SPEC CHECKSUMS:
Orca-iOS: 567ca0e53671d8fc28ba15338db8fe4ff5101d8d
Orca-iOS: d50a0dbbf596f20c6c2e2f727f20f72ac012aa0e

PODFILE CHECKSUM: 2deb98490df78cf895d797180dcfeccea4f2ad25
PODFILE CHECKSUM: 85110c27ad76f2840ec98aff4c162e9ffc71a022

COCOAPODS: 1.15.2
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/orca-node",
"version": "0.2.1",
"version": "1.0.0",
"description": "Picovoice Orca Node.js binding",
"main": "dist/index.js",
"types": "dist/types/index.d.ts",
Expand Down
3 changes: 0 additions & 3 deletions binding/nodejs/src/platforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const PLATFORM_WINDOWS = 'windows';

const ARM_CPU_64 = '-aarch64';
const ARM_CPU_CORTEX_A53 = 'cortex-a53';
const ARM_CPU_CORTEX_A57 = 'cortex-a57';
const ARM_CPU_CORTEX_A72 = 'cortex-a72';
const ARM_CPU_CORTEX_A76 = 'cortex-a76';

Expand Down Expand Up @@ -121,8 +120,6 @@ function getLinuxMachine(arch: string): string {
switch (cpuPart) {
case '0xd03':
return ARM_CPU_CORTEX_A53 + archInfo;
case '0xd07':
return ARM_CPU_CORTEX_A57 + archInfo;
case '0xd08':
return ARM_CPU_CORTEX_A72 + archInfo;
case '0xd0b':
Expand Down
2 changes: 0 additions & 2 deletions binding/python/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ def _linux_machine() -> str:

if "0xd03" == cpu_part:
return "cortex-a53" + arch_info
elif "0xd07" == cpu_part:
return "cortex-a57" + arch_info
elif "0xd08" == cpu_part:
return "cortex-a72" + arch_info
elif "0xd0b" == cpu_part:
Expand Down
2 changes: 1 addition & 1 deletion binding/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

setuptools.setup(
name="pvorca",
version="0.2.4",
version="1.0.0",
author="Picovoice",
author_email="hello@picovoice.ai",
description="Orca Streaming Text-to-Speech Engine",
Expand Down
8 changes: 3 additions & 5 deletions binding/python/test_orca.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@


class OrcaTestCase(unittest.TestCase):
EXACT_ALIGNMENT_TEST_MODEL_IDENTIFIER = "female"

access_key: str
orcas: List[Orca]
model_paths: List[str]
Expand All @@ -48,7 +46,7 @@ def _test_audio(self, pcm: Sequence[int], ground_truth: Sequence[int]) -> None:
pcm = pcm[:len(ground_truth)] # compensate for discrepancies due to wav header
self.assertEqual(len(pcm), len(ground_truth))
for i in range(len(pcm)):
self.assertAlmostEqual(pcm[i], ground_truth[i], delta=8000)
self.assertAlmostEqual(pcm[i], ground_truth[i], delta=12000)

def _test_equal_timestamp(self, timestamp: float, timestamp_truth: float) -> None:
self.assertAlmostEqual(timestamp, timestamp_truth, places=2)
Expand Down Expand Up @@ -105,7 +103,7 @@ def test_synthesize(self) -> None:
def test_synthesize_alignment_exact(self) -> None:
orca = [
orca for i, orca in enumerate(self.orcas) if
self.EXACT_ALIGNMENT_TEST_MODEL_IDENTIFIER in self.model_paths[i]].pop()
test_data.exact_alignment_test_model_identifier in self.model_paths[i]].pop()
pcm, alignments = orca.synthesize(test_data.text_alignment, random_state=test_data.random_state)
self.assertGreater(len(pcm), 0)

Expand All @@ -115,7 +113,7 @@ def test_synthesize_alignment_exact(self) -> None:

def test_synthesize_alignment(self) -> None:
for i, orca in enumerate(self.orcas):
if self.EXACT_ALIGNMENT_TEST_MODEL_IDENTIFIER in self.model_paths[i]:
if test_data.exact_alignment_test_model_identifier in self.model_paths[i]:
continue

pcm, alignments = orca.synthesize(test_data.text_alignment, random_state=test_data.random_state)
Expand Down
9 changes: 5 additions & 4 deletions binding/python/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class TestData:
alignments: Sequence[Orca.WordAlignment]
random_state: int
audio_data_folder: str
exact_alignment_test_model_identifier: str


def read_wav_file(path: str) -> Sequence[int]:
Expand All @@ -49,7 +50,7 @@ def get_test_data() -> TestData:
test_data = json.loads(data_file.read())

alignments = []
for word_data in test_data["alignments"]:
for word_data in test_data.pop("alignments"):
phonemes = []
for phoneme_data in word_data["phonemes"]:
phoneme = Orca.PhonemeAlignment(
Expand All @@ -65,11 +66,11 @@ def get_test_data() -> TestData:
phonemes=phonemes)
alignments.append(word)

test_sentences = test_data.pop("test_sentences")
test_data = TestData(
alignments=alignments,
random_state=test_data["random_state"],
audio_data_folder=test_data["audio_data_folder"],
**test_data["test_sentences"])
**test_data,
**test_sentences)

return test_data

Expand Down
4 changes: 2 additions & 2 deletions binding/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Orca Text-to-Speech engine for web browsers (via WebAssembly)",
"author": "Picovoice Inc",
"license": "Apache-2.0",
"version": "0.2.1",
"version": "1.0.0",
"keywords": [
"orca",
"web",
Expand Down Expand Up @@ -33,7 +33,7 @@
"test-perf": "cypress run --spec test/orca_perf.test.ts"
},
"dependencies": {
"@picovoice/web-utils": "=1.3.4"
"@picovoice/web-utils": "=1.4.2"
},
"devDependencies": {
"@babel/core": "^7.21.3",
Expand Down
10 changes: 7 additions & 3 deletions binding/web/src/orca.ts
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,8 @@ export class Orca {
throw new OrcaErrors.OrcaOutOfMemoryError('malloc failed: Cannot allocate memory');
}

const memoryBufferView = new DataView(this._wasmMemory.buffer);
const memoryBufferUint8 = new Uint8Array(this._wasmMemory.buffer);
let memoryBufferView = new DataView(this._wasmMemory.buffer);
let memoryBufferUint8 = new Uint8Array(this._wasmMemory.buffer);

const initStatus = await this._pvOrcaSynthesizeParamsInit(synthesizeParamsAddressAddress);
if (initStatus !== PvStatus.SUCCESS) {
Expand Down Expand Up @@ -690,6 +690,9 @@ export class Orca {
await this._pvFree(textAddress);
await this._pvOrcaSynthesizeParamsDelete(synthesizeParamsAddress);

memoryBufferView = new DataView(this._wasmMemory.buffer);
memoryBufferUint8 = new Uint8Array(this._wasmMemory.buffer);

if (synthesizeStatus !== PvStatus.SUCCESS) {
const messageStack = await Orca.getMessageStack(
this._pvGetErrorStack,
Expand Down Expand Up @@ -928,7 +931,7 @@ export class Orca {

private static async initWasm(accessKey: string, modelPath: string, wasmBase64: string): Promise<OrcaWasmOutput> {
// A WebAssembly page has a constant size of 64KiB. -> 1MiB ~= 16 pages
const memory = new WebAssembly.Memory({ initial: 7500 });
const memory = new WebAssembly.Memory({ initial: 1600 });
const memoryBufferUint8 = new Uint8Array(memory.buffer);
const pvError = new PvError();
const exports = await buildWasm(memory, wasmBase64, pvError);
Expand Down Expand Up @@ -1025,6 +1028,7 @@ export class Orca {
objectAddressAddress);
await pv_free(accessKeyAddress);
await pv_free(modelPathAddress);

if (initStatus !== PvStatus.SUCCESS) {
const messageStack = await Orca.getMessageStack(
pv_get_error_stack,
Expand Down
6 changes: 3 additions & 3 deletions binding/web/src/orca_worker_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ self.onmessage = async function(
self.postMessage({
command: 'error',
status: PvStatus.RUNTIME_ERROR,
shortMessage: 'Orca synthesize error',
shortMessage: e.message,
});
}
}
Expand Down Expand Up @@ -133,7 +133,7 @@ self.onmessage = async function(
self.postMessage({
command: 'error',
status: PvStatus.RUNTIME_ERROR,
shortMessage: 'Orca stream open error',
shortMessage: e.message,
});
}
}
Expand Down Expand Up @@ -172,7 +172,7 @@ self.onmessage = async function(
self.postMessage({
command: 'error',
status: PvStatus.RUNTIME_ERROR,
shortMessage: 'Orca synthesize error',
shortMessage: e.message,
});
}
}
Expand Down
8 changes: 4 additions & 4 deletions binding/web/test/orca.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ const EXPECTED_VALID_CHARACTERS = [
'-', '/', '1', '2', '3', '4', '5',
'6', '7', '8', '9', '0', '@', '%',
'&', '\n', '_', '(', ')', '°', 'º',
'²', '³',
'²', '³', '$', '€', '¥', '₪', '£',
'₩', '₺', '₱', '₽', '฿', '₴', '₹',
'¢', '+', '=',
];

const EXACT_ALIGNMENT_TEST_MODEL_IDENTIFIER = 'female';

const compareArrays = (arr1: Int16Array, arr2: Int16Array, step: number) => {
expect(arr1.length).eq(arr2.length);
for (let i = 0; i < arr1.length - step; i += step) {
Expand Down Expand Up @@ -179,7 +179,7 @@ describe('Orca Binding', function() {
}
});

if (modelFileSuffix === EXACT_ALIGNMENT_TEST_MODEL_IDENTIFIER) {
if (publicPath.includes(testData.exact_alignment_test_model_identifier)) {
it(`should be able to process alignment exact [${modelFileSuffix}] (${instanceString})`, async () => {
try {
const orca = await instance.create(
Expand Down
8 changes: 4 additions & 4 deletions binding/web/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1122,10 +1122,10 @@
dependencies:
commander "^9.2.0"

"@picovoice/web-utils@=1.3.4":
version "1.3.4"
resolved "https://registry.yarnpkg.com/@picovoice/web-utils/-/web-utils-1.3.4.tgz#de3c4afe39aaf6e620320e413bfdf69bd9921f5d"
integrity sha512-f5bh1jvlbK53EzGdbpbcvNDoz16wbuQ/Fkj+T0GDQulowky+u/HfGZJE7si4vQ/m/2Lctx07X8YxmUHlH2FKGg==
"@picovoice/web-utils@=1.4.2":
version "1.4.2"
resolved "https://registry.yarnpkg.com/@picovoice/web-utils/-/web-utils-1.4.2.tgz#2ddc44552d15fa1a4958e0c3384e58545255eea1"
integrity sha512-pF5Uw3Vm4mOWJ2H3Zc7E/nDr/O7OhbvgEK6W7cx9MNNK3qq51MqiGluPpZ8a2K61BuIzxcNMC1mXWpmIAWVolA==
dependencies:
commander "^10.0.1"

Expand Down
Loading

0 comments on commit 14702c3

Please sign in to comment.