wip
This commit is contained in:
parent
c9d72c848b
commit
7a9afd4a0c
1 changed files with 3 additions and 3 deletions
|
@ -66,9 +66,9 @@ def process_chunk(filename):
|
|||
|
||||
event_time = datetime.now().strftime("%Y%m%d-%H%M%S")
|
||||
base_name = os.path.splitext(filename)[0]
|
||||
wav_out = os.path.join(OUTPUT_DIR, f"{base_name}_{event_time}.wav")
|
||||
flac_out = os.path.join(OUTPUT_DIR, f"{base_name}_{event_time}.flac")
|
||||
png_out = os.path.join(OUTPUT_DIR, f"{base_name}_{event_time}.png")
|
||||
sf.write(wav_out, clip, samplerate)
|
||||
sf.write(flac_out, clip, samplerate, format='FLAC')
|
||||
|
||||
plt.figure()
|
||||
plt.specgram(clip, Fs=samplerate, NFFT=NFFT, noverlap=NFFT//2, cmap='inferno', vmin=-90, vmax=-20)
|
||||
|
@ -79,7 +79,7 @@ def process_chunk(filename):
|
|||
plt.savefig(png_out)
|
||||
plt.close()
|
||||
|
||||
print(f"🎯 Ereignis erkannt bei {event_time}, gespeichert: {wav_out}, {png_out}")
|
||||
print(f"🎯 Ereignis erkannt bei {event_time}, gespeichert: {flac_out}, {png_out}")
|
||||
last_event = i
|
||||
i += skip_samples
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue