diff options
author | John Glover <j@johnglover.net> | 2012-10-03 12:32:54 +0200 |
---|---|---|
committer | John Glover <j@johnglover.net> | 2012-10-03 12:32:54 +0200 |
commit | 98d77b676e13eb362ce85146035bc2f5d098e4f6 (patch) | |
tree | 76ea3271569e64b05c8519f3c48d6825cb35411d /examples | |
parent | cbce075cd66355ff0709bf7fd94a9553946e38c0 (diff) | |
download | simpl-98d77b676e13eb362ce85146035bc2f5d098e4f6.tar.gz simpl-98d77b676e13eb362ce85146035bc2f5d098e4f6.tar.bz2 simpl-98d77b676e13eb362ce85146035bc2f5d098e4f6.zip |
[examples] Bug fix: Use original sampling rate
when writing synthesised audio files.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/harmonicsynthesis.py | 4 | ||||
-rw-r--r-- | examples/residualsynthesis.py | 4 | ||||
-rw-r--r-- | examples/timescale.py | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/examples/harmonicsynthesis.py b/examples/harmonicsynthesis.py index 99d6e39..401025d 100644 --- a/examples/harmonicsynthesis.py +++ b/examples/harmonicsynthesis.py @@ -8,7 +8,7 @@ if len(sys.argv) != 3: print usage sys.exit(1) -audio = simpl.read_wav(sys.argv[1])[0] +audio, sampling_rate = simpl.read_wav(sys.argv[1]) output_file = sys.argv[2] pd = simpl.LorisPeakDetection() @@ -18,4 +18,4 @@ partials = pt.find_partials(peaks) synth = simpl.LorisSynthesis() audio_out = synth.synth(partials) audio_out = np.asarray(audio_out * 32768, np.int16) -wav.write(output_file, 44100, audio_out) +wav.write(output_file, sampling_rate, audio_out) diff --git a/examples/residualsynthesis.py b/examples/residualsynthesis.py index cd41dd4..f3559c8 100644 --- a/examples/residualsynthesis.py +++ b/examples/residualsynthesis.py @@ -8,10 +8,10 @@ if len(sys.argv) != 3: print usage sys.exit(1) -audio = simpl.read_wav(sys.argv[1])[0] +audio, sampling_rate = simpl.read_wav(sys.argv[1]) output_file = sys.argv[2] r = simpl.SMSResidual() audio_out = r.synth(audio) audio_out = np.asarray(audio_out * 32768, np.int16) -wav.write(output_file, 44100, audio_out) +wav.write(output_file, sampling_rate, audio_out) diff --git a/examples/timescale.py b/examples/timescale.py index a83916b..2b061d7 100644 --- a/examples/timescale.py +++ b/examples/timescale.py @@ -10,7 +10,7 @@ if len(sys.argv) != 4: print usage sys.exit(1) -audio = simpl.read_wav(sys.argv[1])[0] +audio, sampling_rate = simpl.read_wav(sys.argv[1]) time_scale_factor = float(sys.argv[2]) output_file = sys.argv[3] @@ -31,4 +31,4 @@ while current_frame < len(partials): current_frame += step_size audio_out = np.asarray(audio_out * 32768, np.int16) -wav.write(output_file, 44100, audio_out) +wav.write(output_file, sampling_rate, audio_out) |