Skip to content

Commit

Permalink
ensure Fortran contiguity in get_duration
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Lostanlen committed Aug 26, 2019
1 parent dc1669c commit 8757052
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions librosa/core/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,10 @@ def get_duration(y=None, sr=22050, S=None, n_fft=2048, hop_length=512,
n_samples = n_samples - 2 * int(n_fft / 2)

else:
# Ensure Fortran contiguity.
if not np.isfortran(y):
y = np.asfortranarray(y)

# Validate the audio buffer. Stereo is okay here.
util.valid_audio(y, mono=False)
if y.ndim == 1:
Expand Down

0 comments on commit 8757052

Please sign in to comment.