Actualiser src/tadam.py
ajout try/except au début de la fonction rate pour palier aux cas où les boitiers créent des fichiers wav erronés illisibles qui bloquent le traitement
This commit is contained in:
parent
772108c218
commit
d874613f81
@ -62,8 +62,11 @@ def usage():
|
||||
|
||||
|
||||
def rate(infile, outfile, rate_ratio):
|
||||
data, samplerate = sf.read(infile)
|
||||
new_samplerate = int(samplerate * rate_ratio)
|
||||
try:
|
||||
data, samplerate = sf.read(infile)
|
||||
new_samplerate = int(samplerate * rate_ratio)
|
||||
except sf.LibsndfileError as e:
|
||||
print("ERROR : {0}".format(e))
|
||||
try:
|
||||
sf.write(outfile, data, new_samplerate)
|
||||
except:
|
||||
|
Loading…
Reference in New Issue
Block a user