Code Monkey home page Code Monkey logo

koala's Introduction

Koala

GitHub release GitHub

Maven Central npm CocoaPods PyPI

Made in Vancouver, Canada by Picovoice

Twitter URL YouTube Channel Views

Koala is an on-device noise suppression engine. Koala is:

  • Private; All voice processing runs locally.
  • Cross-Platform:
    • Linux (x86_64), macOS (x86_64, arm64), Windows (x86_64)
    • Android and iOS
    • Chrome, Safari, Firefox, and Edge
    • Raspberry Pi (3, 4, 5) and NVIDIA Jetson Nano

Table of Contents

AccessKey

AccessKey is your authentication and authorization token for deploying Picovoice SDKs, including Koala. Anyone who is using Picovoice needs to have a valid AccessKey. You must keep your AccessKey secret. You would need internet connectivity to validate your AccessKey with Picovoice license servers even though the noise suppression is running 100% offline.

AccessKey also verifies that your usage is within the limits of your account. Everyone who signs up for Picovoice Console receives the Free Tier usage rights described here. If you wish to increase your limits, you can purchase a subscription plan.

Demos

Python Demos

Install the demo package:

pip3 install pvkoalademo
koala_demo_mic --access_key ${ACCESS_KEY} --output_path ${WAV_OUTPUT_PATH}
koala_demo_file \
    --access_key ${ACCESS_KEY} \
    --input_path ${WAV_INPUT_PATH} \
    --output_path ${WAV_OUTPUT_PATH}

Replace ${ACCESS_KEY} with yours obtained from Picovoice Console.

Android Demo

Using Android Studio, open demo/android/Activity as an Android project and then run the application.

Replace "${YOUR_ACCESS_KEY_HERE}" in the file MainActivity.java with your AccessKey.

iOS Demo

Copy your AccessKey into the ACCESS_KEY variable inside ViewModel.swift.

Before building the demo app, run the following from KoalaDemo directory to install the Koala-iOS CocoaPod:

pod install

Open KoalaDemo.xcworkspace and run the demo.

C Demos

Build the demo:

cmake -S demo/c/ -B demo/c/build && cmake --build demo/c/build --target koala_demo_mic

To list the available audio input devices:

./demo/c/build/koala_demo_mic -s

To run the demo:

./demo/c/build/koala_demo_mic -l ${LIBRARY_PATH} -m ${MODEL_PATH} -a ${ACCESS_KEY} -o ${WAV_OUTPUT_PATH}

Replace ${LIBRARY_PATH} with path to appropriate library available under lib, ${MODEL_PATH} with path to the model file available under lib/common, ${ACCESS_KEY} with AccessKey obtained from Picovoice Console, and ${WAV_OUTPUT_PATH} with a path to a .wav file where the enhanced audio will be stored. Terminate the demo with Ctrl+C.

For more information about C demos go to demo/c.

Web Demo

From demo/web run the following in the terminal:

yarn
yarn start

(or)

npm install
npm run start

Open http://localhost:5000 in your browser to try the demo.

SDKs

Python

Install the Python SDK:

pip3 install pvkoala

Create an instance of the engine and enhance audio in real-time:

import pvkoala

koala = pvkoala.create(access_key='${ACCESS_KEY}')

Replace ${ACCESS_KEY} with yours obtained from Picovoice Console.

def get_next_audio_frame():
    pass

while True:
    enhanced_audio = koala.process(get_next_audio_frame())

Finally, when done be sure to explicitly release the resources using koala.delete().

Android

To include the package in your Android project, ensure you have included mavenCentral() in your top-level build.gradle file and then add the following to your app's build.gradle:

dependencies {
    implementation 'ai.picovoice:koala-android:${LATEST_VERSION}'
}

Create an instance of the engine and enhance audio in real-time:

import ai.picovoice.koala.*;

final String accessKey = "${ACCESS_KEY}"; // AccessKey obtained from Picovoice Console (https://console.picovoice.ai/)

short[] getNextAudioFrame() {
    // .. get audioFrame
    return audioFrame;
}

try {
    Koala koala = new Koala.Builder()
        .setAccessKey(accessKey)
        .build(appContext);

    while true {
        short[] enhancedFrame = koala.process(getNextAudioFrame());
    };

} catch (KoalaException ex) { }

Replace ${ACCESS_KEY} with yours obtained from Picovoice Console.

iOS

Create an instance of the engine and enhance audio:

import Koala

do {
  let koala = try Koala(accessKey: "${ACCESS_KEY}")
} catch {}

func getNextAudioFrame() -> [Int16] {
  // .. get a frame of audio
  return audioFrame;
}

while true {
  do {
    let enhancedAudio = try koala.process(getNextAudioFrame())
    // .. use enhanced audio
  } catch {}
}

Replace ${ACCESS_KEY} with yours obtained from Picovoice Console.

In case the next audio frame does not directly follow the previous one, call koala.reset().

When done be sure to explicitly release the resources using koala.delete().

C

include/pv_koala.h header file contains relevant information. Build an instance of the object:

    pv_koala_t *handle = NULL;
    const char *model_path = "${MODEL_PATH}";
    pv_status_t status = pv_koala_init(${ACCESS_KEY}, model_path, &handle);
    if (status != PV_STATUS_SUCCESS) {
        // error handling logic
    }

Replace ${ACCESS_KEY} with the AccessKey obtained from Picovoice Console, and ${MODEL_PATH} with the path to the model file available under lib/common.

Now the handle can be used to enhance audio in real-time:

extern const int16_t *get_next_audio_frame(void);

const int32_t frame_length = pv_koala_frame_length();
int16_t *enhanced_pcm = (int16_t *) malloc(frame_length * sizeof(int16_t));

while (true) {
    const int16_t *pcm = get_next_audio_frame();
    const pv_status_t status = pv_koala_process(handle, pcm, enhanced_pcm);
    if (status != PV_STATUS_SUCCESS) {
        // error handling logic
    }
}

Finally, when done be sure to release the acquired resources:

pv_koala_delete(handle);

Web

Install the web SDK using yarn:

yarn add @picovoice/koala-web

or using npm:

npm install --save @picovoice/koala-web

Create an instance of the engine using KoalaWorker and enhance audio in real-time:

import { Koala } from "@picovoice/koala-web";
import koalaParams from "${PATH_TO_BASE64_KOALA_PARAMS}";

function processCallback(enhancedPcm) {
  // do something with enhancedPcm
}

function getAudioData(): Int16Array {
... // function to get audio data
  return new Int16Array();
}

const koala = await KoalaWorker.create(
  "${ACCESS_KEY}",
  processCallback,
  { base64: koalaParams },
);

await koala.reset();
for (;;) {
    await koala.process(getAudioData());
}

Replace ${ACCESS_KEY} with yours obtained from Picovoice Console. Finally, when done release the resources using koala.release().

Releases

v2.0.0 - November 24th, 2023

  • Improvements to error reporting
  • Upgrades to authorization and authentication system
  • Various bug fixes and improvements
  • Web min support bumped to Node 16
  • iOS support bumped to iOS 13

v1.0.0 - February 7th, 2023

  • Initial release

koala's People

Contributors

albho avatar bejager avatar dependabot[bot] avatar dominikbuenger avatar erismik avatar kenarsa avatar ksyeo1010 avatar laves avatar mrrostam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

koala's Issues

Picovoice Issue: Koala startup not working on Google Cloud Run

I've been able to run the Koala SDK locally, however when I deploy my code to Google Cloud Run, I get an pvkoala._koala.KoalaInvalidArgumentError when initializing the client - no other error message.

My Picovoice console says that I have 0/3 monthly active users, and I've successfully been able to run the SDK from multiple different machines (without the active users count increasing).

Do I need to be on the Developer plan for this? My username is [email protected].

Would love a flutter plugin for Koala

I use Porcupine and Rhino in a flutter app and would love to add Koala to improve the speech recognition for both the wake word and the speech-to-intent.
Is there a Flutter Koala plugin in the works?
Thanks!
Jeff

using Picovoice Koala on the ARM architecture ARM11

Hello Picovoice team,

I am interested in using Picovoice Koala on the ARM architecture ARM11. I noticed that the current version of Koala only supports Raspberry Pi 3 and 4, and I was wondering if you have plans to add ARM11 support in the future. Additionally, if I would like to experience Picovoice immediately on ARM11, is there any way to do so? Thank you for your help and guidance.

Koala uses "Monthly Usage Hours"

Is your feature request related to a problem? Please describe.
I'm very happy you made software for noise cancellation. But I'm sad it's used my hours quota.

Describe the solution you'd like
Please move Koala's business model as (Rhino, Porcupine, Cobra). ๐Ÿ™

Additional context
image

Thank you so much for your great software.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.