# -*- coding: utf-8 -*-
"""Untitled6.ipynb

Automatically generated by Colaboratory.

Original file is located at
    https://colab.research.google.com/drive/1GMOMOvglvUnHotTrmxQeXtsPhuySyl9o
"""

from pydub import AudioSegment
import parselmouth
import numpy as np
import seaborn as snsp


def speech_recognition_pitch(source):
  sound = AudioSegment.from_file(source)
  sound.export('source.wav', format="wav")
  
  snsp.set()
  snd = parselmouth.Sound("source.wav")

  pitch = snd.to_pitch()

  pitch_values = pitch.selected_array['frequency']
  return pitch_values

