(self, audio_data, sample_rate=None)
Caculate power spectrum or log power spectrum 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 N containing add-noise audio.
Caculate power spectrum or log power spectrum 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 N containing add-noise audio.
Caculate power spectrum or log power spectrum 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 N containing add - noise audio .
def call(self, audio_data, sample_rate=None):
    """
        Caculate power spectrum or log power spectrum 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 N containing add-noise audio.
        """

    p = self.config
    with tf.name_scope('add_rir_noise_aecres'):
      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]):
        sample_rate = tf.cast(sample_rate, dtype=float)
        add_rir_noise_aecres_out = py_x_ops.add_rir_noise_aecres(
            audio_data,
            sample_rate,
            if_add_rir=p.if_add_rir,
            rir_filelist=p.rir_filelist,
            if_add_noise=p.if_add_noise,
            snr_min=p.snr_min,
            snr_max=p.snr_max,
            noise_filelist=p.noise_filelist,
            if_add_aecres=p.if_add_aecres,
            aecres_filelist=p.aecres_filelist)

        return tf.squeeze(add_rir_noise_aecres_out)
def call ( self , audio_data , sample_rate = None ) : p = self . config with tf . name_scope ( 'add_rir_noise_aecres' ) : 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 ] ) : sample_rate = tf . cast ( sample_rate , dtype = float ) add_rir_noise_aecres_out = py_x_ops . add_rir_noise_aecres ( audio_data , sample_rate , if_add_rir = p . if_add_rir , rir_filelist = p . rir_filelist , if_add_noise = p . if_add_noise , snr_min = p . snr_min , snr_max = p . snr_max , noise_filelist = p . noise_filelist , if_add_aecres = p . if_add_aecres , aecres_filelist = p . aecres_filelist ) return tf . squeeze ( add_rir_noise_aecres_out )