Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
simransinghal authored Nov 26, 2017
1 parent 68caaca commit 21f0973
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
22 changes: 22 additions & 0 deletions mp32wav.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
#Script: mp32wav script (requires mpg123 package)
#Purpose: Loops through a path and convert all the mp3s to wavs
#
#usage: mp32wav [Path]

count=0

if [ -n "$1" ]; then
cd "$1"
ls
for file in *.mp3
do
let "count += 1"
echo "$1/$file" > sedEdit
name =`echo "$file" | cut -d'.' -f1`
mpg123 -w ./waves/${file}.wav $file
done
fi
echo "$count mp3s found and converted to wavs... [Baileysoft 2005]"
rm sedEdit
exit 0
22 changes: 11 additions & 11 deletions svm_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from sklearn.metrics import accuracy_score, precision_score, recall_score
import numpy as np
from csv import reader
from sklearn.manifold.t_sne import TSNE
#from sklearn.manifold.t_sne import TSNE

def load_csv(filename):
file = open(filename, "rt")
Expand Down Expand Up @@ -66,17 +66,17 @@ def SVM(train_data, train_labels, test_data, test_labels):
metrics.append(SVM(train_data, train_labels, test_data, test_labels))
fold += 1

accuracy = 0.00
precision = 0.00
recall = 0.00
fi = 0.00
for i in metrics:
accuracy = 0.00
precision = 0.00
recall = 0.00
fi = 0.00
for i in metrics:
accuracy += i[0]
precision += i[1]
recall += i[2]
fi += i[3]
accuracy = accuracy/5.0
precision = precision/5.0
recall = recall/5.0
fi = fi/5.0
print (accuracy),(","),(precision),(", "),(recall),(", "),(fi)
accuracy = accuracy/5.0
precision = precision/5.0
recall = recall/5.0
fi = fi/5.0
print (accuracy),(","),(precision),(", "),(recall),(", "),(fi)

0 comments on commit 21f0973

Please sign in to comment.