(self, audio_data, sample_rate)
Caculate logmelspectrum of audio data.
       :param audio_data: the audio signal from which to compute spectrum.
                          Should be an (1, N) tensor.
       :param sample_rate: [option]the samplerate of the signal we working with,
                            default is 16kHz.
       :return: A float tensor of size (num_frames, num_channels) containing
               melspectrum features of every frame in speech.
Caculate logmelspectrum of audio data.
       :param audio_data: the audio signal from which to compute spectrum.
                          Should be an (1, N) tensor.
       :param sample_rate: [option]the samplerate of the signal we working with,
                            default is 16kHz.
       :return: A float tensor of size (num_frames, num_channels) containing
               melspectrum features of every frame in speech.
Caculate logmelspectrum of audio data . : param audio_data : the audio signal from which to compute spectrum . Should be an ( 1 N ) tensor . : param sample_rate : [ option ] the samplerate of the signal we working with default is 16kHz . : return : A float tensor of size ( num_frames num_channels ) containing melspectrum features of every frame in speech .
def call(self, audio_data, sample_rate):
    """
       Caculate logmelspectrum of audio data.
       :param audio_data: the audio signal from which to compute spectrum.
                          Should be an (1, N) tensor.
       :param sample_rate: [option]the samplerate of the signal we working with,
                            default is 16kHz.
       :return: A float tensor of size (num_frames, num_channels) containing
               melspectrum features of every frame in speech.
    """
    p = self.config

    with tf.name_scope('melspectrum'):

      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]):

        spectrum = self.spect(audio_data, sample_rate)
        spectrum = tf.expand_dims(spectrum, 0)
        sample_rate = tf.cast(sample_rate, dtype=tf.int32)

        mel_spectrum = py_x_ops.mel_spectrum(
            spectrum,
            sample_rate,
            upper_frequency_limit=p.upper_frequency_limit,
            lower_frequency_limit=p.lower_frequency_limit,
            filterbank_channel_count=p.filterbank_channel_count)

        mel_spectrum_out = tf.squeeze(mel_spectrum, axis=0)

        return mel_spectrum_out
def call ( self , audio_data , sample_rate ) : p = self . config with tf . name_scope ( 'melspectrum' ) : 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 ] ) : spectrum = self . spect ( audio_data , sample_rate ) spectrum = tf . expand_dims ( spectrum , 0 ) sample_rate = tf . cast ( sample_rate , dtype = tf . int32 ) mel_spectrum = py_x_ops . mel_spectrum ( spectrum , sample_rate , upper_frequency_limit = p . upper_frequency_limit , lower_frequency_limit = p . lower_frequency_limit , filterbank_channel_count = p . filterbank_channel_count ) mel_spectrum_out = tf . squeeze ( mel_spectrum , axis = 0 ) return mel_spectrum_out