#! /usr/bin/env python

from Tkinter import *
from tkSnack import *
root = Tkinter.Tk();

initializeSnack(root);


import sys;

path=sys.argv[1];
startsample=int(sys.argv[2]);
endsample=int(sys.argv[3]);

#startsample=0;
#endsample=0;
#endsample=430; #should bigger 1024 like 2048.

#mysound=Sound(file=path);
#formant only work memory.
mysound=Sound(load=path);
#mysound.convert(encoding='Lin16',channels='1');



#sample like 11025
if endsample == 0:
	endsample=mysound.length();
elif endsample <0:
	endsample=mysound.length()+endsample;

#print endsample;

resultList=mysound.formant(framelength='0.01',start=startsample,end=endsample);

#print len(resultList);

for i in resultList:
	print i;