Permalink
Browse files

Prevent resampling if no sample_rate is provided to load_clip.

  • Loading branch information...
1 parent cd3089b commit d0dcea42baefa9ea454dc9e9b79020d79d96da07 Leif Johnson committed Dec 12, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lmj/sound/__init__.py
View
@@ -29,7 +29,7 @@
def load_clip(filename, sample_rate=None, normalize=False):
'''Return a sound clip with some standard preprocessing applied.'''
clip = Clip(filename)
- if sample_rate != clip.sample_rate:
+ if sample_rate is not None and sample_rate != clip.sample_rate:
if sample_rate < clip.sample_rate:
clip.lowpass_filter(sample_rate / 2)
clip.set_sample_rate(sample_rate)

0 comments on commit d0dcea4

Please sign in to comment.