Skip to content

Commit

Permalink
replace TARGET_ST by pcen_settings["sr"]
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Lostanlen committed Nov 21, 2018
1 parent 06577db commit 1ea544f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions birdvoxdetect/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import os
import soundfile as sf

TARGET_SR = 22050

def _center_audio(audio, frame_len):
"""Center audio so that first sample will occur in the middle of the first frame"""
Expand Down Expand Up @@ -58,8 +57,8 @@ def get_likelihood(audio, sr, frame_rate):
audio = np.mean(audio, axis=1)

# Resample to 22,050 kHz
if not sr == TARGET_SR:
audio = librosa.resample(audio, sr, TARGET_SR)
if not sr == pcen_settings["sr"]:
audio = librosa.resample(audio, sr, pcen_settings["sr"])

# Load settings.
pcen_settings = get_pcen_settings()
Expand Down

0 comments on commit 1ea544f

Please sign in to comment.