Skip to content

Instantly share code, notes, and snippets.

@deepwilson
Created February 8, 2019 08:28
Show Gist options
  • Save deepwilson/6428599b0df4f5bd2b158de56db20314 to your computer and use it in GitHub Desktop.
Save deepwilson/6428599b0df4f5bd2b158de56db20314 to your computer and use it in GitHub Desktop.
from subprocess import check_output
import sys
import os
def rough_frequency_check(file):
freq = str(check_output('sox \"' +file+ '\" -n stat 2>&1 |findstr "Rough frequency" ',shell=True)) #Windows
# RMS = str(check_output('sox \"' +file+ '\" -n stat 2>&1 |grep "RMS" ',shell=True)) #ubuntu
freq=freq.split(":")[1]
freq=freq.split("\\")[0]
freq=int(freq)
# freq=round(freq,5)
# print('Name of file is:',file)
# print('Rough frequencies in file : ',freq)
return freq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment