Skip to content

Instantly share code, notes, and snippets.

@AdolfVonKleist
AdolfVonKleist / ltsd_vad.py
Created March 27, 2017 13:09
Simple Voice Activity Detection based on Long-term Spectral Divergence
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import wave
import numpy as np
import scipy as sp
WINSIZE=8192
sound='sound.wav'
def read_signal(filename, winsize):
@AdolfVonKleist
AdolfVonKleist / karaoke_spectral_subtruction.py
Created March 27, 2017 11:41 — forked from shunsukeaihara/karaoke_spectral_subtruction.py
Singing voice enhancement by spectral subtraction method using karaoke sound
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import scipy as sp
import numpy as np
import math
import optparse
import tempfile
import wave
from itertools import izip
@AdolfVonKleist
AdolfVonKleist / UserStore.js
Created July 28, 2016 10:34 — forked from JedWatson/UserStore.js
Simple store-prototype example for a User Store + View
var Store = require('store-prototype');
var UserStore = new Store();
var users = {};
var loaded = false;
UserStore.extend({
loadUsers: function() {
loadUsersSomehow(function(err, results) {
users = results;
#!/bin/bash
# Obtain the latest version of the CMU dict from github
wget https://raw.githubusercontent.com/cmusphinx/cmudict/master/cmudict.dict -O cmudict.dict
# Get rid of the alternative pronunciation markers and normalize formatting
cat cmudict.dict | perl -e 'while (<>) {
chomp;
@_ = split (/\s+/);
$w = shift (@_);
$w =~ s/\([0-9]+\)//;
@AdolfVonKleist
AdolfVonKleist / compute-best-mix.py
Last active May 29, 2020 08:50
compute-best-mix.py : Python port of the venerated SRILM tool
#!/usr/bin/python
import re, math
def LoadPPLFile (pplfile) :
"""
Load up the salient info from a -debug 2 PPL file
generated by the SRILM ngram tool.
"""
ppl_info = []
@AdolfVonKleist
AdolfVonKleist / little-test.sh
Created April 9, 2014 07:16
phonetisaurus script
#!/bin/bash
if [ $# -ne 2 ]
then
echo "USAGE: $0 <lexicon> <order>"
echo " Recommended: order=6~9 for English"
exit
fi
#Triage the lexicon a bit to overcome my poor design
@AdolfVonKleist
AdolfVonKleist / README.txt
Created October 8, 2013 18:25
Play around with WCT scores.
Play around with WCT scores using the .csv files from the ASP website.
Download the latest rankings in .csv format:
http://www.aspworldtour.com/rankings/asp-world-championship-tour-ranking
Run the parse-asp.py script with the .csv file:
$ ./parse-asp.py --csv wct.csv
@AdolfVonKleist
AdolfVonKleist / get-bccwj-examples.py
Last active December 16, 2015 01:09
More usable, simple, standalone WSGI interface to the Balanced Corpus of Contemporary Written Japanese: http://www.kotonoha.gr.jp/shonagon/ Run the script from a termina: $ ./get-bccwj-examples.py then view in your browser at: localhost:8000. Run the script with '--help' to see additional options. Script will cache your vocabulary search results…
#!/usr/bin/python
# -*- mode: python; coding: utf-8 -*-
from wsgiref.simple_server import make_server
from cgi import parse_qs, escape
import urllib, urllib2, cookielib, sqlite3, re
html = """
<html>
<head>
<style type="text/css">
@AdolfVonKleist
AdolfVonKleist / EandMfunctions.cpp
Created July 27, 2012 15:44
Expectation and Maximization functions from M2MFstAligner
void M2MFstAligner::expectation( ){
for( int i=0; i<fsas.size(); i++ ){
//Comput Forward and Backward probabilities
ShortestDistance( fsas.at(i), &alpha );
ShortestDistance( fsas.at(i), &beta, true );
//Compute the normalized Gamma probabilities and
// update our running tally
for( StateIterator<VectorFst<LogArc> > siter(fsas.at(i)); !siter.Done(); siter.Next() ){
LogArc::StateId q = siter.Value();
@AdolfVonKleist
AdolfVonKleist / rsurfing.css
Created June 17, 2012 09:48
r/surfing CSS
/*
CSS markup customization for r/surfing - 2012
Most of this CSS was cribbed from other subreddits or tutorials with
special mention going out to:
r/battlefield3, r/skyrim, r/fitness, and r/trees
Credit for the various images can be found below in the related
code blocks.
*/