Changeset cf34922 for python


Ignore:
Timestamp:
Jun 12, 2006, 2:54:47 PM (18 years ago)
Author:
Paul Brossier <piem@altern.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
1917053
Parents:
16109b3
Message:

use os.path in task.cut to derive default output filenames
use os.path in task.cut to derive default output filenames

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/aubio/task/cut.py

    r16109b3 rcf34922  
    77                parameters should be set *before* calling this method.
    88                """
     9                from os.path import basename,splitext
    910                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)
    1214                self.fileo      = sndfile(self.newname,model=self.filei)
    1315                self.myvec      = fvec(self.params.hopsize,self.channels)
     
    3234                                        zerocross += 1
    3335                        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)
    3738                        writesize = self.fileo.write(fromcross,self.mycopy)
    3839                else:
Note: See TracChangeset for help on using the changeset viewer.