Showing the changes to python (1 of 1 file). Show all
Unified · Split
| @@ -6,9 +6,11 @@ class taskcut(task): · 5 unmodified lines | ||
| 6 | 6 | """ open the input file and initialize arguments |
| 7 | 7 | parameters should be set *before* calling this method. |
| 8 | 8 | """ |
| 9 | + from os.path import basename,splitext | |
| 9 | 10 | task.__init__(self,input,output=None,params=params) |
| 10 | − self.newname = "%s%s%09.5f%s%s" % (self.input.split(".")[0].split("/")[-1],".", | |
| 11 | − self.frameread*self.params.step,".",self.input.split(".")[-1]) | |
| 11 | + self.soundoutbase, self.soundoutext = splitext(basename(self.input)) | |
| 12 | + self.newname = "%s%s%09.5f%s%s" % (self.soundoutbase,".", | |
| 13 | + self.frameread*self.params.step,".",self.soundoutext) | |
| 12 | 14 | self.fileo = sndfile(self.newname,model=self.filei) |
| 13 | 15 | self.myvec = fvec(self.params.hopsize,self.channels) |
| 14 | 16 | self.mycopy = fvec(self.params.hopsize,self.channels) |
| @@ -31,9 +33,8 @@ class taskcut(task): · 16 unmodified lines | ||
| 31 | 33 | fromcross += 1 |
| 32 | 34 | zerocross += 1 |
| 33 | 35 | del self.fileo |
| 34 | − self.fileo = sndfile("%s%s%09.5f%s%s" % | |
| 35 | − (self.input.split(".")[0].split("/")[-1],".", | |
| 36 | − self.frameread*self.params.step,".",self.input.split(".")[-1]),model=self.filei) | |
| 36 | + self.fileo = sndfile("%s%s%09.5f%s%s" % (self.soundoutbase,".", | |
| 37 | + self.frameread*self.params.step,".",self.soundoutext),model=self.filei) | |
| 37 | 38 | writesize = self.fileo.write(fromcross,self.mycopy) |
| 38 | 39 | else: |
| 39 | 40 | writesize = self.fileo.write(self.readsize,self.myvec) |