Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

Cannot run whispering: Error opening InputStream: Invalid sample rate [PaErrorCode -9997] #78

Closed
hippylover opened this issue Jan 7, 2023 · 3 comments
Labels
Status: Stale Type: Question Further information is requested

Comments

@hippylover
Copy link

hippylover commented Jan 7, 2023

[2023-01-07 02:32:33,394] cli.get_wshiper:225 DEBUG -> WhisperConfig: model_name='tiny' device='cpu' language='en' fp16=True
[2023-01-07 02:32:33,795] transcriber._set_dtype:35 INFO -> Using FP32 because FP16 is not supported on CPU
Using cache found in /home/kris/.cache/torch/hub/snakers4_silero-vad_master
[2023-01-07 02:32:34,701] cli.get_context:239 DEBUG -> Context: protocol_version=6003 timestamp=0.0 buffer_tokens=[] buffer_mel=None nosoeech_skip_count=None temperatures=[0.0, 0.2, 0.4, 0.6, 0.8, 1.0] patience=None compression_ratio_threshold=2.4 logprob_threshold=-1.0 no_captions_threshold=0.6 best_of=5 beam_size=5 no_speech_threshold=0.6 buffer_threshold=0.5 vad_threshold=0.5 max_nospeech_skip=16 mel_frame_min_num=3000 data_type='float32'
[2023-01-07 02:32:34,701] cli.transcribe_from_mic:56 INFO -> Ready to transcribe
Expression 'paInvalidSampleRate' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2050
Expression 'PaAlsaStreamComponent_InitialConfigure( &self->capture, inParams, self->primeBuffers, hwParamsCapture, &realSr )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2721
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2845
Traceback (most recent call last):
  File "/home/kris/.local/bin/whispering", line 8, in <module>
    sys.exit(main())
  File "/home/kris/.local/lib/python3.10/site-packages/whispering/cli.py", line 343, in main
    for text in transcribe_from_mic(
  File "/home/kris/.local/lib/python3.10/site-packages/whispering/cli.py", line 57, in transcribe_from_mic
    with sd.InputStream(
  File "/home/kris/.local/lib/python3.10/site-packages/sounddevice.py", line 1421, in __init__
    _StreamBase.__init__(self, kind='input', wrap_callback='array',
  File "/home/kris/.local/lib/python3.10/site-packages/sounddevice.py", line 898, in __init__
    _check(_lib.Pa_OpenStream(self._ptr, iparameters, oparameters,
  File "/home/kris/.local/lib/python3.10/site-packages/sounddevice.py", line 2747, in _check
    raise PortAudioError(errormsg, err)
sounddevice.PortAudioError: Error opening InputStream: Invalid sample rate [PaErrorCode -9997]

I tried adding another sample rate to ~/.asoundrc to mic(i hate alsa config though and this shouldnt be neccessary in the first place), but it didnt work. Not sure i am doing the right thing...

@shirayu shirayu added the Type: Question Further information is requested label Jan 7, 2023
@shirayu
Copy link
Owner

shirayu commented Jan 7, 2023

The sampling rate of whisper is fixed to 16000.
I'm sorry but not sure the setting of alsa.

@hippylover
Copy link
Author

whisper alone works on my computer. perhaps i do not have a good enough graphics card? I have this: https://ark.intel.com/content/www/us/en/ark/products/196603/intel-core-i51035g1-processor-6m-cache-up-to-3-60-ghz.html#tab-blade-1-0-4

@github-actions
Copy link

This issue is stale because it has been open for 21 days with no activity.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Status: Stale Type: Question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants