From 705cf3d172794855d87f3ad3efc76ae8e9e0a39e Mon Sep 17 00:00:00 2001 From: Malar Kannan Date: Tue, 28 Nov 2017 12:52:00 +0530 Subject: [PATCH] finding exact duration of sound sample --- speech_pitch.py | 3 +++ speech_tts_queue.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/speech_pitch.py b/speech_pitch.py index 12cd6af..a17b5b3 100644 --- a/speech_pitch.py +++ b/speech_pitch.py @@ -66,6 +66,8 @@ def pm_snd(sample_file): # sample_file = 'inputs/self-apple/apple-low1.aiff' samples, samplerate, _ = snd.read(sample_file) return pm.Sound(values=samples,sampling_frequency=samplerate) + + def plot_sample_raw(sample_file='outputs/audio/sunflowers-Victoria-180-normal-870.aiff'): # %matplotlib inline # sample_file='outputs/audio/sunflowers-Victoria-180-normal-870.aiff @@ -128,6 +130,7 @@ if __name__ == '__main__': # alex150spec.shape # alex_mfcc.shape # fred_180_norm_mfcc.shape + mom_snd = pm_snd('outputs/test/moms_are_engineers-7608.aiff') plot_sample_pitch('outputs/audio/sunflowers-Victoria-180-normal-870.aiff') plot_sample_pitch('inputs/self-apple/apple-low1.aiff') plot_sample_pitch('inputs/self-apple/apple-low2.aiff') diff --git a/speech_tts_queue.py b/speech_tts_queue.py index 950a11a..ceb5dcf 100644 --- a/speech_tts_queue.py +++ b/speech_tts_queue.py @@ -184,7 +184,7 @@ def story_texts(): def generate_audio(): synthQ = SynthesizerQueue() - phrases = random.sample(story_texts(), 5) # story_texts() + phrases = random.sample(story_texts(), 100) # story_texts() f = open(csv_dest_file, 'w') s_csv_w = csv.writer(f, quoting=csv.QUOTE_MINIMAL) i = 0