montreal_forced_aligner/corpus/acoustic_corpus.py
def mfcc(self) -> None:
        """
        Multiprocessing function that converts sound files into MFCCs.

        See :kaldi_docs:`feat` for an overview on feature generation in Kaldi.

        See Also
        --------
        :class:`~montreal_forced_aligner.corpus.features.MfccFunction`
            Multiprocessing helper function for each job
        :meth:`.AcousticCorpusMixin.mfcc_arguments`
            Job method for generating arguments for helper function
        :kaldi_steps:`make_mfcc`
            Reference Kaldi script
        """
        self.log_info("Generating MFCCs...")
        log_directory = os.path.join(self.split_directory, "log")
        os.makedirs(log_directory, exist_ok=True)
        with tqdm.tqdm(total=self.num_utterances) as pbar:
            if self.use_mp:
                manager = mp.Manager()
                error_dict = manager.dict()
                return_queue = manager.Queue()
                stopped = Stopped()
                procs = []
                for i, args in enumerate(self.mfcc_arguments()):
                    function = MfccFunction(args)
                    p = KaldiProcessWorker(i, return_queue, function, error_dict, stopped)
                    procs.append(p)
                    p.start()
                while True:
                    try:
                        num_utterances = return_queue.get(timeout=1)
                        # print(utterance)
                        if stopped.stop_check():
                            continue
                    except Empty:
                        for proc in procs:
                            if not proc.finished.stop_check():
                                break
                        else:
                            break
                        continue
                    pbar.update(num_utterances)
                for p in procs:
                    p.join()
                if error_dict:
                    for v in error_dict.values():
                        raise v
            else:
                for args in self.mfcc_arguments():
                    function = MfccFunction(args)
                    for num_utterances in function.run():
                        pbar.update(num_utterances)

        Multiprocessing function that converts sound files into MFCCs.

        See :kaldi_docs:`feat` for an overview on feature generation in Kaldi.

        See Also
        --------
        :class:`~montreal_forced_aligner.corpus.features.MfccFunction`
            Multiprocessing helper function for each job
        :meth:`.AcousticCorpusMixin.mfcc_arguments`
            Job method for generating arguments for helper function
        :kaldi_steps:`make_mfcc`
            Reference Kaldi script
        
Multiprocessing function that converts sound files into MFCCs.
See :kaldi_docs:`feat` for an overview on feature generation in Kaldi.

See Also
Multiprocessing function that converts sound files into MFCCs . See : kaldi_docs : ` feat ` for an overview on feature generation in Kaldi . See Also
def mfcc(self) -> None:
        self.log_info("Generating MFCCs...")
        log_directory = os.path.join(self.split_directory, "log")
        os.makedirs(log_directory, exist_ok=True)
        with tqdm.tqdm(total=self.num_utterances) as pbar:
            if self.use_mp:
                manager = mp.Manager()
                error_dict = manager.dict()
                return_queue = manager.Queue()
                stopped = Stopped()
                procs = []
                for i, args in enumerate(self.mfcc_arguments()):
                    function = MfccFunction(args)
                    p = KaldiProcessWorker(i, return_queue, function, error_dict, stopped)
                    procs.append(p)
                    p.start()
                while True:
                    try:
                        num_utterances = return_queue.get(timeout=1)
                        if stopped.stop_check():
                            continue
                    except Empty:
                        for proc in procs:
                            if not proc.finished.stop_check():
                                break
                        else:
                            break
                        continue
                    pbar.update(num_utterances)
                for p in procs:
                    p.join()
                if error_dict:
                    for v in error_dict.values():
                        raise v
            else:
                for args in self.mfcc_arguments():
                    function = MfccFunction(args)
                    for num_utterances in function.run():
                        pbar.update(num_utterances)
def mfcc ( self ) -> None : self . log_info ( "Generating MFCCs..." ) log_directory = os . path . join ( self . split_directory , "log" ) os . makedirs ( log_directory , exist_ok = True ) with tqdm . tqdm ( total = self . num_utterances ) as pbar : if self . use_mp : manager = mp . Manager ( ) error_dict = manager . dict ( ) return_queue = manager . Queue ( ) stopped = Stopped ( ) procs = [ ] for i , args in enumerate ( self . mfcc_arguments ( ) ) : function = MfccFunction ( args ) p = KaldiProcessWorker ( i , return_queue , function , error_dict , stopped ) procs . append ( p ) p . start ( ) while True : try : num_utterances = return_queue . get ( timeout = 1 ) if stopped . stop_check ( ) : continue except Empty : for proc in procs : if not proc . finished . stop_check ( ) : break else : break continue pbar . update ( num_utterances ) for p in procs : p . join ( ) if error_dict : for v in error_dict . values ( ) : raise v else : for args in self . mfcc_arguments ( ) : function = MfccFunction ( args ) for num_utterances in function . run ( ) : pbar . update ( num_utterances )
Multiprocessing function that converts sound files into MFCCs.
Multiprocessing function that converts sound files into MFCCs .
"""
        Multiprocessing function that converts sound files into MFCCs.

        See :kaldi_docs:`feat` for an overview on feature generation in Kaldi.

        See Also
        --------
        :class:`~montreal_forced_aligner.corpus.features.MfccFunction`
            Multiprocessing helper function for each job
        :meth:`.AcousticCorpusMixin.mfcc_arguments`
            Job method for generating arguments for helper function
        :kaldi_steps:`make_mfcc`
            Reference Kaldi script
        """ # print(utterance)
self
class
`~montreal_forced_aligner.corpus.features.MfccFunction`
Multiprocessing helper function for each job
` ~montreal_forced_aligner . corpus . features . MfccFunction ` Multiprocessing helper function for each job
meth
`.AcousticCorpusMixin.mfcc_arguments`
Job method for generating arguments for helper function
` . AcousticCorpusMixin . mfcc_arguments ` Job method for generating arguments for helper function
kaldi_steps
`make_mfcc`
Reference Kaldi script
` make_mfcc ` Reference Kaldi script