(* ::Package:: *)

(************************************************************************)
(* This file was generated automatically by the Mathematica front end.  *)
(* It contains Initialization cells from a Notebook file, which         *)
(* typically will have the same name as this file except ending in      *)
(* ".nb" instead of ".m".                                               *)
(*                                                                      *)
(* This file is intended to be loaded into the Mathematica kernel using *)
(* the package loading commands Get or Needs.  Doing so is equivalent   *)
(* to using the Evaluate Initialization Cells menu command in the front *)
(* end.                                                                 *)
(*                                                                      *)
(* DO NOT EDIT THIS FILE.  This entire file is regenerated              *)
(* automatically each time the parent Notebook file is saved in the     *)
(* Mathematica front end.  Any changes you make to this file will be    *)
(* overwritten.                                                         *)
(************************************************************************)



(* ::Input::Initialization:: *)
SetDirectory["C:\\drorbn\\AcademicPensieve\\Projects\\dbnvp"]


(* ::Input::Initialization:: *)
Options[MakeTranscript]={SegmentLength->60, SaveTo->None};
MakeTranscript[v_String]:=MakeTranscript[Source->"C:/drorbn/dbnvp/orig/"<>v, SaveTo->v<>".txt"];
MakeTranscript[opts__Rule]:=Module[
{
src=Source /. {opts},
txt=SaveTo /. {opts} /. Options[MakeTranscript],
d = SegmentLength /. {opts} /. Options[MakeTranscript],
audio,len, transcript
},
audio=Import[src, "Audio"];
len=QuantityMagnitude[Duration[audio],"Second"];
Echo[len/60];
transcript=Table[Echo@{t,SpeechRecognize[audio,Masking->{t-1,t+d+1}]},{t,0.,len-1,d}];
transcript
]



