django-simple-captcha
django-simple-captcha copied to clipboard
/usr/bin/sox FAIL sox: Input files must have the same sample-rate
When trying to use audio Captcha, I get the following error from sox
: /usr/bin/sox FAIL sox: Input files must have the same sample-rate
.
It seems to be coming from the second call to sox
(line 180) :
https://github.com/mbi/django-simple-captcha/blob/137fe973188ddd8feaaa58961ef9bce70eb5d7da/captcha/views.py#L165-L195
Since sox
fails, line 195 raises a FileNotFoundError:
on mergedpath
.
Any way to solve this ?
I'm using django 3.1.6
with Python 3.9.1
.
-
settings.py
:
CAPTCHA_FONT_SIZE = 30
CAPTCHA_IMAGE_SIZE = (210, 50)
CAPTCHA_LENGTH = 8
CAPTCHA_FLITE_PATH = "/usr/bin/flite"
CAPTCHA_SOX_PATH = "/usr/bin/sox"
Can't really reproduce, which version of flite and sox are you using?
This works for me (using your settings)
~ sox --version
sox: SoX v14.4.2
~ flite --version
Carnegie Mellon University, Copyright (c) 1999-2016, all rights reserved
version: flite-2.1-release Dec 2017 (http://cmuflite.org)
Hello @qcoumes I was just bit by this issue myself. It seems to me the same version of flite sometimes outputs PCM Wave at 8kHz (on e.g. Debian), and sometimes at 16kHz (on e.g. Arch). Do you happen to remember which how you had tested?