NVIDIA-AI-IOT / jetson-cloudnative-demo

Multi-container demo for Jetson Xavier NX and Jetson AGX Xavier
MIT License
186 stars 45 forks source link

Jetson Voice Invalid sample rate #9

Open DavidNguyen95 opened 3 years ago

DavidNguyen95 commented 3 years ago

I am running jetson voice container follow https://ngc.nvidia.com/catalog/containers/nvidia:jetson-voice

I tried 2 difference micro devices (micro usb and micro built in usb camera) but they still do not work. And My camera info at /proc/asound/card4/stream0 Capture: Status: Stop Interface 3 Altset 1 Format: S16_LE Channels: 1 Endpoint: 4 IN (ASYNC) Rates: 8000, 11025, 16000, 22050, 24000, 44100, 48000 Data packet interval: 1000 u

My microphone infor at/proc/asound/card2/stream0 `C-Media Electronics Inc. USB PnP Sound Device at usb-3610000.xhci-2.1, full spe : USB Audio

Capture: Status: Stop Interface 1 Altset 1 Format: S16_LE Channels: 1 Endpoint: 2 IN (ADAPTIVE) Rates: 48000, 44100`

Here is information of microphone devices inside jetson voice container :when I run ./scripts/list_microphones.sh

Input Device ID 24 - USB PnP Sound Device: Audio (hw:2,0) (inputs=1) (sample_rate=44100) Input Device ID 26 - USB Camera: Audio (hw:4,0) (inputs=1) (sample_rate=44100)

When I run python3 src/test_asr.py --mic 24 The usb microphone got error: [Errno -9997] Invalid sample rate Traceback (most recent call last): File "src/test_asr.py", line 66, in <module> asr_engine.start(on_asr_transcript) File "/workspace/src/asr/jarvis/asr_engine.py", line 59, in start self.audio_generator, "mic", transcript_callback) File "/workspace/src/asr/jarvis/speech_utils.py", line 875, in streaming_recognize for response in responses: File "/usr/local/lib/python3.6/dist-packages/grpc/_channel.py", line 416, in __next__ return self._next() File "/usr/local/lib/python3.6/dist-packages/grpc/_channel.py", line 706, in _next raise self

in case the camera: When I run python3 src/test_asr.py --mic 26 The microphone build in camera auto turn off. But the code maybe works but because micro off so it doesn’t receive signal , by this reason the results is so wrong: "Phrase: Fine. (1.000000) Phrase: O e. (1.000000) Partial: Ae (1.000000) Partial: O a (1.000000) Phrase: A e e. (1.000000) Phrase: E o o. (1.000000) "

Do you have any suggestion to reduce the sample rate of microphone? or any suggestion? Thank you Dat

dusty-nv commented 3 years ago

Hi Dat, I don't have resampling built in, so you would need to use a microphone that supports 16KHz sampling rate.

BTW I have a different/newer version of this project at https://github.com/dusty-nv/jetson-voice but it also currently requires 16KHz sample rate.

BTW what microphone are you using? I would like to get one that doesn't support 16KHz so that I can implement/test the resampling.