Comments (16)
Here's how you can run the examples:
- clone the miniaudio repo and
cd
into theexamples
directory - run the command from their README (either one under
Examples
. You may have to change some paths based on your file structure.) - run the output file with with the path to an existing audio file on your device. If working, you'll hear the audio being played out of your speakers.
If this doesn't work, it would be helpful if you could try our file demo and see if that works.
from cobra.
Can you try the simple capture example to see if you can record audio, since that is how PvRecorder will be used?
As well, please also try our file demo so we can see if Cobra can initialize.
from cobra.
Okay, so since it seems like the issue stems from miniaudio, I recommend you check out the miniaudio docs and see if you can get it working on your device.
from cobra.
Which Raspberry Pi model are you using? Are you using Debian directly or via the Rpi OS? Are you using 32-bit or 64-bit for Debian?
from cobra.
64bit raspberry pi OS installed via pi imager.
from cobra.
Thanks, and which model are you using?
from cobra.
Ah, sorry. It's 3 B.
from cobra.
I'm not able to reproduce the error on my device. Could you give our Node.js demo a try and confirm that that works on your device?
from cobra.
Just tested. It is the same error via the demo:
rpi@rpi:~ $ cobra-mic-demo --access_key <...>
/usr/local/lib/node_modules/@picovoice/cobra-node-demo/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 (/usr/local/lib/node_modules/@picovoice/cobra-node-demo/node_modules/@picovoice/cobra-node/dist/errors.js:76:19)
at Cobra.handlePvStatus (/usr/local/lib/node_modules/@picovoice/cobra-node-demo/node_modules/@picovoice/cobra-node/dist/cobra.js:134:46)
at new Cobra (/usr/local/lib/node_modules/@picovoice/cobra-node-demo/node_modules/@picovoice/cobra-node/dist/cobra.js:59:18)
at micDemo (/usr/local/lib/node_modules/@picovoice/cobra-node-demo/mic.js:69:24)
at Object.<anonymous> (/usr/local/lib/node_modules/@picovoice/cobra-node-demo/mic.js:126:1)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12) {
_message: 'Cobra failed to initialize',
_messageStack: [
'Picovoice Error (code `00000136`)',
'Picovoice Error (code `00000136`)'
]
}
rpi@rpi:~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 2: Microphones [Blue Microphones], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
The following command records the wav with the input from mic:
arecord -D plughw:2,0 -d 5 test.wav
from cobra.
Is your device connected to internet while initializing?
from cobra.
Yes, It does.
Just tried on fresh installation by installing just npm and the demo package. Now, the error is different:
rpi@rpi:~ $ cobra-mic-demo --access_key <...>
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM input
ALSA lib pcm_dsnoop.c:566:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dsnoop.c:566:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dsnoop.c:566:(snd_pcm_dsnoop_open) unable to open slave
/usr/local/lib/node_modules/@picovoice/cobra-node-demo/node_modules/@picovoice/pvrecorder-node/dist/errors.js:47
return new PvRecorderStatusRuntimeError(errorMessage);
^
PvRecorderStatusRuntimeError: PvRecorder failed to initialize.
at pvRecorderStatusToException (/usr/local/lib/node_modules/@picovoice/cobra-node-demo/node_modules/@picovoice/pvrecorder-node/dist/errors.js:47:20)
at new PvRecorder (/usr/local/lib/node_modules/@picovoice/cobra-node-demo/node_modules/@picovoice/pvrecorder-node/dist/pv_recorder.js:47:40)
at micDemo (/usr/local/lib/node_modules/@picovoice/cobra-node-demo/mic.js:73:20)
at Object.<anonymous> (/usr/local/lib/node_modules/@picovoice/cobra-node-demo/mic.js:126:1)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
at node:internal/main/run_main_module:28:49
The recording still working fine with arecord.
What am i missing?
from cobra.
Ah, I ran the demo using the full RPi OS instead of the Lite - it's possible you're missing a package. We use mini audio to access the recording device. Could you run one of their examples and make sure mini audio is recording properly?
Alternatively, you can also try our file demo instead, which doesn't require any recording device.
from cobra.
I didn't find a quick and easy way to check if it is working in their docs. The example page you referenced doesn't make a lot of sense to me honestly. Maybe you could suggest which steps I should perform to validate mini audio.
from cobra.
I was able to play audio file via compiled miniaudio. How it can help though?
from cobra.
I just checked the simple capture example. Indeed it seems smth is missing:
rpi@rpi:~/miniaudio/examples/bin $ ./simple_capture test.mp3
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM input
ALSA lib pcm_dsnoop.c:566:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dsnoop.c:566:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dsnoop.c:566:(snd_pcm_dsnoop_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Press Enter to stop recording...
from cobra.
Closing because this seems like an issue with miniaudio/audio recording and not cobra
from cobra.
Related Issues (20)
- Cobra Issue: running alongside Porcupine Angular creates `IO_ERROR` HOT 6
- Cobra Issue: error when starting the cobra_mic_demo on a raspberry pi 4 HOT 2
- support 8 kHz sampling rate HOT 2
- Golang Binding HOT 2
- Flutter support HOT 1
- VAD and Recording Audio File simultaneously HOT 7
- Cobra Issue: VAD-Performance with noise HOT 5
- Cobra's dependence on input signal strength HOT 6
- Cobra's dependence on input signal strength HOT 1
- Node.js bindings? HOT 3
- SDK for Unity Game Engine? HOT 2
- Node Version HOT 2
- Cobra Issue: error when using with node.js for a server HOT 5
- Provide Go SDK for Cobra HOT 3
- Implement `std::error::Error` for `CobraError` in Rust binding HOT 2
- Issues using PV on Pi 5 HOT 3
- Missing documentation for audio files HOT 1
- Cobra Issue: On IOS there is a constant error "WARN Sending `frame_sent` with no listeners registered." (BTW and on Android it works fine). HOT 4
- Cobra implementation doubt: continuously alternating between 2 audio sources HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cobra.