(self, audio_data, sample_rate=None)
Caculate mfcc features of audio data.
    :param audio_data: the audio signal from which to compute spectrum.
                       Should be an (1, N) tensor.
    :param sample_rate: the samplerate of the signal we working with.
    :return: A float tensor of size (num_channels, num_frames, num_frequencies)
            containing mfcc features of every frame in speech.
Caculate mfcc features of audio data.
    :param audio_data: the audio signal from which to compute spectrum.
                       Should be an (1, N) tensor.
    :param sample_rate: the samplerate of the signal we working with.
    :return: A float tensor of size (num_channels, num_frames, num_frequencies)
            containing mfcc features of every frame in speech.
Caculate mfcc features of audio data . : param audio_data : the audio signal from which to compute spectrum . Should be an ( 1 N ) tensor . : param sample_rate : the samplerate of the signal we working with . : return : A float tensor of size ( num_channels num_frames num_frequencies ) containing mfcc features of every frame in speech .
def call(self, audio_data, sample_rate=None):
    """
    Caculate mfcc features of audio data.
    :param audio_data: the audio signal from which to compute spectrum.
                       Should be an (1, N) tensor.
    :param sample_rate: the samplerate of the signal we working with.
    :return: A float tensor of size (num_channels, num_frames, num_frequencies)
            containing mfcc features of every frame in speech.
    """
    p = self.config
    with tf.name_scope('mfcc'):

      if sample_rate == None:
        sample_rate = tf.constant(p.sample_rate, dtype=tf.int32)

      assert_op = tf.assert_equal(
          tf.constant(p.sample_rate), tf.cast(sample_rate, dtype=tf.int32))
      with tf.control_dependencies([assert_op]):

        fbank_feats = self.fbank(audio_data, sample_rate)
        sample_rate = tf.cast(sample_rate, dtype=tf.int32)
        shape = tf.shape(fbank_feats)
        nframe = shape[0]
        nfbank = shape[1]
        fbank_feats = tf.reshape(fbank_feats, (1, nframe, nfbank))
        framepow_feats = self.framepow(audio_data, sample_rate)
        mfcc = py_x_ops.mfcc(
            fbank_feats,
            framepow_feats,
            sample_rate,
            use_energy=p.use_energy,
            cepstral_lifter=p.cepstral_lifter,
            coefficient_count=p.coefficient_count)
        return mfcc
def call ( self , audio_data , sample_rate = None ) : p = self . config with tf . name_scope ( 'mfcc' ) : if sample_rate == None : sample_rate = tf . constant ( p . sample_rate , dtype = tf . int32 ) assert_op = tf . assert_equal ( tf . constant ( p . sample_rate ) , tf . cast ( sample_rate , dtype = tf . int32 ) ) with tf . control_dependencies ( [ assert_op ] ) : fbank_feats = self . fbank ( audio_data , sample_rate ) sample_rate = tf . cast ( sample_rate , dtype = tf . int32 ) shape = tf . shape ( fbank_feats ) nframe = shape [ 0 ] nfbank = shape [ 1 ] fbank_feats = tf . reshape ( fbank_feats , ( 1 , nframe , nfbank ) ) framepow_feats = self . framepow ( audio_data , sample_rate ) mfcc = py_x_ops . mfcc ( fbank_feats , framepow_feats , sample_rate , use_energy = p . use_energy , cepstral_lifter = p . cepstral_lifter , coefficient_count = p . coefficient_count ) return mfcc