Compare commits

...

2 Commits

Author SHA1 Message Date
e2cd25007f Merge pull request 'Actualiser src/tadam.py' (#2) from babakounine/TadaridaTools:master into master
Reviewed-on: #2
2024-05-17 18:37:33 +02:00
d874613f81 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
2024-02-19 22:31:57 +01:00

View File

@ -62,8 +62,11 @@ def usage():
def rate(infile, outfile, rate_ratio): def rate(infile, outfile, rate_ratio):
data, samplerate = sf.read(infile) try:
new_samplerate = int(samplerate * rate_ratio) data, samplerate = sf.read(infile)
new_samplerate = int(samplerate * rate_ratio)
except sf.LibsndfileError as e:
print("ERROR : {0}".format(e))
try: try:
sf.write(outfile, data, new_samplerate) sf.write(outfile, data, new_samplerate)
except: except: