GithubHelp home page GithubHelp logo

picovoice / cobra Goto Github PK

View Code? Open in Web Editor NEW
141.0 11.0 10.0 41.19 MB

On-device voice activity detection (VAD) powered by deep learning

Home Page: https://picovoice.ai/

License: Apache License 2.0

Ruby 1.09% Swift 9.22% Python 31.49% TypeScript 27.84% C 6.82% Rust 23.06% Shell 0.48%
voice-activity-detection speech-recognition vad on-device voice-activity voice-activity-detector

cobra's Issues

Cobra Issue: running alongside Porcupine Angular creates `IO_ERROR`

Cobra stops working when porcupine service in installed and used in angular

getting this error

core.mjs:6494 ERROR Error: Uncaught (in promise): Error: 'pv_cobra_init' failed with status IO_ERROR
at resolvePromise (zone.js:1211:1)
at zone.js:1118:1
at asyncGeneratorStep (asyncToGenerator.js:6:1)
at _throw (asyncToGenerator.js:29:1)
at _ZoneDelegate.invoke (zone.js:372:1)
at Object.onInvoke (core.mjs:25608:1)
at _ZoneDelegate.invoke (zone.js:371:1)
at Zone.run (zone.js:134:1)
at zone.js:1275:1
at _ZoneDelegate.invokeTask (zone.js:406:1)

when working with only cobra VAD it works fine, but once i installed porcupine service it stops working

support 8 kHz sampling rate

Is your feature request related to a problem? Please describe.
I am using python library to detect voice activity in audio file. but we are going to receive input from stream and it is going to be 8000hz single channel audio. But when I try to test with audio of 8khz sampling rate then library fails because it is not 16000hz rate.

Describe the solution you'd like
Please provide option to set sampling rate for input file.

Additional context
Audio stream will be coming from twilio and we do not have control on the frequency they provide, it is always going to be 8000hz single channel audio. But here we want to use picovoice cobra for activity detection but it is not supported.

Cobra Issue: On IOS there is a constant error "WARN Sending `frame_sent` with no listeners registered." (BTW and on Android it works fine).

Have you checked the docs and existing issues?

  • I have read all of the relevant Picovoice Cobra docs
  • I have searched the existing issues for Cobra

SDK

iOS

Cobra package version

2.0.1

Framework version

EXPO CLI 0.17.8

Platform

iOS

OS/Browser version

N/A

Describe the bug

I use your example of Cobra for IOS . It works however I keep getting endless warning messages:
"WARN Sending frame_sent with no listeners registered."
On android it works fine.

Steps To Reproduce

It is reproducible on my environment. On simulator and real devices. Just run the IOS example and watch terminal console for messages.

Expected Behavior

Not to receive the warning messages ""WARN Sending frame_sent with no listeners registered." or a better message that explains where this is in the stack etc'

VAD offline

Hi there,
can VAD be ran offline without the need of access keys, etc..
will the models be released publicly

Implement `std::error::Error` for `CobraError` in Rust binding

Is your feature request related to a problem? Please describe.
CobraError does not implement the standard std::error::Error trait, which means that the use of the ? syntax in Result returning functions is not available.

Describe the solution you'd like
Implement std::error::Error for CobraError. As the type already implements Display, it may literally be as simple as adding impl std::error::Error for CobraError {}, and relying on the provided functions - possibly a literal one-liner.

Describe alternatives you've considered
It is possible to workaround this by simply mapping the error, but it's a shame to need to, and a pity for a small and otherwise quite ergonomic library (although some more Rust-like changes to the API would be possible).

Additional context
n/a

Provide Go SDK for Cobra

Is your feature request related to a problem? Please describe.
Very much in need of vad detection technology, but using the go sdk, which I've found that TEAM doesn't provide at the moment!

Describe the solution you'd like
Provide golang sdk

Describe alternatives you've considered
I checked the sdk for the other go parts in the pico voice project, most of them are based on the cgo packaging, and currently cobra has c support, can you quickly convert it to cgo and add go support, but since I don't know c I can't do it to provide pr

SDK for Unity Game Engine?

Is your feature request related to a problem? Please describe.
Not really.

Describe the solution you'd like
A more easy to implement SDK for the Unity Game Engine.

Describe alternatives you've considered
I can probably just write the plugins my self, I just have no idea how too.

Picovoice Error (code `00000136`) when running cobra on RPI via Node

Have you checked the docs and existing issues?

  • I have read all of the relevant Picovoice Cobra docs
  • I have searched the existing issues for Cobra

SDK

Node.js

Cobra package version

2.0.0

Framework version

Node v18.19.0

Platform

Raspberry Pi

OS/Browser version

Debian GNU/Linux 12 (bookworm)

Describe the bug

Running the Cobra on the device gives an initialization error.
An API key is correctly set up, and the internet connection and USB microphone suppose to work.

The error I am getting that doesn't make a lot of sense:

/home/rpi/voice-assistant-poc/node_modules/@picovoice/cobra-node/dist/errors.js:76
            throw new CobraIOError(errorMessage, messageStack);
                  ^

CobraIOError: Cobra failed to initialize: 
  [0] Picovoice Error (code `00000136`)
  [1] Picovoice Error (code `00000136`)
    at pvStatusToException (/home/rpi/voice-assistant-poc/node_modules/@picovoice/cobra-node/dist/errors.js:76:19)
    at Cobra.handlePvStatus (/home/rpi/voice-assistant-poc/node_modules/@picovoice/cobra-node/dist/cobra.js:134:46)
    at new Cobra (/home/rpi/voice-assistant-poc/node_modules/@picovoice/cobra-node/dist/cobra.js:59:18)
   ...{
  _message: 'Cobra failed to initialize',
  _messageStack: [
    'Picovoice Error (code `00000136`)',
    'Picovoice Error (code `00000136`)'
  ]
}

Steps To Reproduce

  1. this.cobra = new Cobra(apiKey)
  2. Error

Expected Behavior

The error message gives more details, or the error code is described in Picovoise documentation.

Cobra's dependence on input signal strength

Hello Picovoice Team!

After testing with Cobra, I have found the following:

The performance of Cobra decreases gradually and the voice becomes harder to recognize when I divide the signal into smaller portions. This makes it difficult for us to determine a fixed volume level for Cobra to operate most effectively because the signal volume from the microphone is constantly changing. Is this a bug or is it normal?

Below is a chart showing the VAD output of the original signal and the signal divided by 10.
VAD

Thank you.

Golang Binding

  • I am using Porcupine with Go and want to use Cobra too.
  • But Cobra does not have Go binding yet. (I can use C directly in Go, but I don't want to :))
  • I wonder if there is any roadmap for this.

Thank you.

Cobra's dependence on input signal strength

Hello Piovoice team. This issue is a continuation of the feedback from issue #141. Here I have a recording used by the high-end Zoom H8 Audio Recorder and the audio file is also of high quality with full higher content frequency. Similar to the experiment above, after dividing the samples into 10 parts, I noticed that the result of Picovoice Cobra had changed. I think you can also test and verify the results through my wave file:

H8_Handy_Recorder.wav

Below is a chart showing the VAD output of the original signal and the signal divided by 10:
VADouput

I am looking forward to your feedback and how to fix it. Thank you so much.

Flutter support

Is there any doc for flutter or any implementation in progress? Would be awesome.

Issues using PV on Pi 5

I am attempting to utilize the package in order to create a DaVinci voice assistant using a Raspberry Pi 5. I am getting the following error when trying to start DaVinci. I posted on their issues section as well, but I see that the issue is with pvcobra specifically, so I came here.

The error:

Traceback (most recent call last):
File "/home/ty/DaVinci/DaVinci.py", line 8, in
import pvcobra
File "/home/ty/.local/lib/python3.11/site-packages/pvcobra/init.py", line 12, in
from ._factory import *
File "/home/ty/.local/lib/python3.11/site-packages/pvcobra/_factory.py", line 15, in
from ._util import *
File "/home/ty/.local/lib/python3.11/site-packages/pvcobra/_util.py", line 64, in
_PV_SYSTEM, _PV_MACHINE = _pv_platform()
^^^^^^^^^^^^^^
File "/home/ty/.local/lib/python3.11/site-packages/pvcobra/_util.py", line 57, in _pv_platform
pv_machine = _pv_linux_machine(platform.machine())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ty/.local/lib/python3.11/site-packages/pvcobra/_util.py", line 48, in _pv_linux_machine
raise NotImplementedError('Unsupported CPU.\n%s' % cpu_info)
NotImplementedError: Unsupported CPU.
processor : 0
BogoMIPS : 108.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x4
CPU part : 0xd0b
CPU revision : 1

processor : 1
BogoMIPS : 108.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x4
CPU part : 0xd0b
CPU revision : 1

processor : 2
BogoMIPS : 108.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x4
CPU part : 0xd0b
CPU revision : 1

processor : 3
BogoMIPS : 108.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x4
CPU part : 0xd0b
CPU revision : 1

Revision : d04170
Serial : 28a0b219c4dec773
Model : Raspberry Pi 5 Model B Rev 1.0

Cobra Issue: VAD-Performance with noise

Hello Picovoice Team.

Currently, I am using Picovoice Cobra to detect voice from a walkie-talkie signal. Is there any way to improve the performance of Cobra? i noticed that the VAD flag is not set in cases where there is noise interference, specifically in this case, noise from the walkie-talkie signal. Could you give me some advice on how to address this issue? Could the interference from the walkie-talkie be disrupting the signal processing of Cobra?

Attached is the WAV file we recorded. voice_with_noise

Tks so much!

Cobra Issue: error when using with node.js for a server

Make sure you have read the documentation, and have put forth a reasonable effort to find an existing answer.

Expected behaviour

Actual behaviour

after installing the sdk and trying to use it, I'm getting this error:
node:internal/modules/cjs/loader:1080
throw err;
^

Error: Cannot find module '@picovoice/cobra-web'
Require stack:

Steps to reproduce the behaviour

(Include enough details so that the issue can be reproduced independently.)

Cobra Issue: error when starting the cobra_mic_demo on a raspberry pi 4

When trying so lunch the cobra_mic_demo using the python sdk and after well installing the package. an error occurs

Expected behaviour

The normal start of the cobra_demo_mic (probability of speech)

Actual behaviour

Traceback (most recent call last):
File "/home/pi/.local/lib/python3.9/site-packages/pvcobrademo/cobra_demo_mic.py", line 61, in run
cobra = pvcobra.create(
File "/home/pi/.local/lib/python3.9/site-packages/pvcobra/init.py", line 30, in create
return Cobra(library_path=library_path, access_key=access_key)
File "/home/pi/.local/lib/python3.9/site-packages/pvcobra/cobra.py", line 130, in init
raise self._PICOVOICE_STATUS_TO_EXCEPTIONstatus
pvcobra.cobra.CobraActivationError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/.local/bin/cobra_demo_mic", line 8, in
sys.exit(main())
File "/home/pi/.local/lib/python3.9/site-packages/pvcobrademo/cobra_demo_mic.py", line 130, in main
CobraDemo(
File "/home/pi/.local/lib/python3.9/site-packages/pvcobrademo/cobra_demo_mic.py", line 95, in run
recorder.delete()
AttributeError: 'NoneType' object has no attribute 'delete'

Steps to reproduce the behaviour

Launch the commande cobra_demo_mic --access_key TOKEN

on raspbian bullseye 64 system (raspberry pi 4) 2 GB

Node Version

Is there any chance of getting a supported version for Node? Thanks!

Node.js bindings?

Hey! Curious if you have plans to make Node.js bindings?

I wrote a websocket server in Node.js that's streaming audio from a phone call via Twilio. I'm currently using WebRTC VAD, but the accuracy is really poor—would love to upgrade to Cobra.

Also, Twilio streams phone calls as μ-law encoded raw audio at an 8kHz sample rate. I've been using the wavefile package to up-sample and reformat the audio, but I'm not sure if that's best practice. If you have any input or suggestions there, it'd be much appreciated!

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.