Returns an array of inputs generated from the
    wake word audio that shouldn't cause an activation
321786
def vectorize_inhibit(audio: np.ndarray) -> np.ndarray:
    

    def samp(x):
        return int(pr.sample_rate * x)

    inputs = []
    for offset in range(samp(inhibit_t), samp(inhibit_dist_t), samp(inhibit_hop_t)):
        if len(audio) - offset < samp(pr.buffer_t / 2.):
            break
        inputs.append(vectorize(audio[:-offset]))
    return np.array(inputs) if inputs else np.empty((0, pr.n_features, pr.feature_size))
496189
def __listeners_for_thread(self):
        """"""

        thread = get_thread_ident()
        with self.lock:
            return [l for tid, l in self.listeners.items() if tid == thread]
131598
function(audio) {
      var self = this || Howler;

      // Don't add audio to the pool if we don't know if it has been unlocked.
      if (audio._unlocked) {
        self._html5AudioPool.push(audio);
      }

      return self;
    }
213456
def generateNoise(self):
        
        # Fill wfb array with white noise based on given discrete variance
        wfb = np.zeros(self.nr*2)
        wfb[:self.nr] = np.random.normal(0, np.sqrt(self.qd), self.nr)
        # Generate the hfb coefficients based on the noise type
        mhb = -self.b/2.0
        hfb = np.zeros(self.nr*2)
        hfb = np.zeros(self.nr*2)
        hfb[0] = 1.0
        indices = np.arange(self.nr-1)
        hfb[1:self.nr] = (mhb+indices)/(indices+1.0)
        hfb[:self.nr] = np.multiply.accumulate(hfb[:self.nr])
        # Perform discrete Fourier transform of wfb and hfb time series
        wfb_fft = np.fft.rfft(wfb)
        hfb_fft = np.fft.rfft(hfb)
        # Perform inverse Fourier transform of the product of wfb and hfb FFTs
        time_series = np.fft.irfft(wfb_fft*hfb_fft)[:self.nr]
        self.time_series = time_series
158919
public ArrayList<PayloadType.Audio> getAudioPayloadTypesList() {
        ArrayList<PayloadType.Audio> result = new ArrayList<>();
        Iterator<JinglePayloadType> jinglePtsIter = getJinglePayloadTypes();

        while (jinglePtsIter.hasNext()) {
            JinglePayloadType jpt = jinglePtsIter.next();
            if (jpt instanceof JinglePayloadType.Audio) {
                JinglePayloadType.Audio jpta = (JinglePayloadType.Audio) jpt;
                result.add((PayloadType.Audio) jpta.getPayloadType());
            }
        }

        return result;
    }
904408
def get_downbeat_steps(self):
        
        if self.downbeat is None:
            return []
        downbeat_steps = np.nonzero(self.downbeat)[0].tolist()
        return downbeat_steps
871457
function Bformat_binDecoder(audioCtx)
{
    this.initialized = false;
    
    this.ctx = audioCtx;
    this.decFilters = new Array(4);
    this.decFilterNodes = new Array(4);
    // input and output nodes
    this.in = this.ctx.createChannelSplitter(4);
    this.out = this.ctx.createChannelMerger(2);
    // downmixing gains for left and right ears
    this.gainMid = this.ctx.createGain();
    this.gainSide = this.ctx.createGain();
    this.invertSide = this.ctx.createGain();
    this.gainMid.gain.value = 1;
    this.gainSide.gain.value = 1;
    this.invertSide.gain.value = -1;
    // initialize convolvers
    for (var i=0; i<4; i++) {
        this.decFilterNodes[i] = this.ctx.createConvolver();
        this.decFilterNodes[i].normalize = false;
    }
    // initialize filters to plain opposing cardioids
    this.resetFilters();
    
    // Create connections
    for (var i=0; i<4; i++) {
        this.in.connect(this.decFilterNodes[i],i,0);
        
        if (i==2) this.decFilterNodes[i].connect(this.gainSide,0,0);
        else this.decFilterNodes[i].connect(this.gainMid,0,0);
    }
    this.gainMid.connect(this.out,0,0);
    this.gainSide.connect(this.out,0,0);

    this.gainMid.connect(this.out,0,1);
    this.gainSide.connect(this.invertSide,0,0);
    this.invertSide.connect(this.out,0,1);
    
    this.initialized = true;
}
390759
private static void readSound(AudioInputStream input, SourceDataLine dataLine) throws IOException
    {
        int read;
        final byte[] buffer = new byte[BUFFER];
        while ((read = input.read(buffer, 0, buffer.length)) > 0)
        {
            dataLine.write(buffer, 0, read);
        }
    }
389426
def _load_audio_list(self, path):
        

        result = {}

        for entry in textfile.read_separated_lines_generator(path, separator='\t', max_columns=4):
            for i in range(len(entry)):
                if entry[i] == '\\N':
                    entry[i] = None

            if len(entry) < 4:
                entry.extend([None] * (4 - len(entry)))

            if not self.include_empty_licence and entry[2] is None:
                continue

            if self.include_licenses is not None and entry[2] not in self.include_licenses:
                continue

            result[entry[0]] = entry[1:]

        return result
651995
function() {
      var self = this;
      var parent = self._parent;

      // Reset all of the parameters of this sound.
      self._muted = parent._muted;
      self._loop = parent._loop;
      self._volume = parent._volume;
      self._rate = parent._rate;
      self._seek = 0;
      self._rateSeek = 0;
      self._paused = true;
      self._ended = true;
      self._sprite = '__default';

      // Generate a new ID so that it isn't confused with the previous sound.
      self._id = ++Howler._counter;

      return self;
    }
747585
def to_array(self):
        
        array = super(ForceReply, self).to_array()
        array['force_reply'] = bool(self.force_reply)  # type bool
        if self.selective is not None:
            array['selective'] = bool(self.selective)  # type bool
        return array
1175385
def get_deep_features(self, audio_data, verbose):
        '''
        
        '''
        preprocessed_data, row_ids = self._preprocess_data(audio_data, verbose)
        deep_features = self._extract_features(preprocessed_data, verbose)

        output = _tc.SFrame({'deep features': deep_features, 'row id': row_ids})
        output = output.unstack('deep features')

        max_row_id = len(audio_data)
        missing_ids = set(range(max_row_id)) - set(output['row id'].unique())
        if len(missing_ids) != 0:
            empty_rows = _tc.SFrame({'List of deep features': [ [] for _ in range(len(missing_ids)) ],
                                     'row id': missing_ids})
            output = output.append(empty_rows)

        output = output.sort('row id')
        return output['List of deep features']
965050
public List<PayloadType> getAudioPayloadTypesList() {
        ArrayList<PayloadType> result = new ArrayList<>();
        Iterator<PayloadType> jinglePtsIter = getPayloadTypes();

        while (jinglePtsIter.hasNext()) {
            PayloadType jpt = jinglePtsIter.next();
            if (jpt instanceof PayloadType.Audio) {
                PayloadType.Audio jpta = (PayloadType.Audio) jpt;
                result.add(jpta);
            }
        }

        return result;
    }
8391
def _audio_item(self, stream_url=None, offset=0, push_buffer=True, opaque_token=None):
        """"""
        audio_item = {'stream': {}}
        stream = audio_item['stream']

        # existing stream
        if not stream_url:
            # stream.update(current_stream.__dict__)
            stream['url'] = current_stream.url
            stream['token'] = current_stream.token
            stream['offsetInMilliseconds'] = current_stream.offsetInMilliseconds

        # new stream
        else:
            stream['url'] = stream_url
            stream['token'] = opaque_token or str(uuid.uuid4())
            stream['offsetInMilliseconds'] = offset

        if push_buffer:  # prevents enqueued streams from becoming current_stream
            push_stream(stream_cache, context['System']['user']['userId'], stream)
        return audio_item
1149305
def vectorize_raw(audio: np.ndarray) -> np.ndarray:
    """"""
    if len(audio) == 0:
        raise InvalidAudio('Cannot vectorize empty audio!')
    return vectorizers[pr.vectorizer](audio)
1116890
def generate(self):
        '''
        
        '''
        generated_arr = np.random.uniform(
            low=0.1,
            high=0.9,
            size=((self.__batch_size, self.__seq_len, self.__dim))
        )

        if self.noise_sampler is not None:
            self.noise_sampler.output_shape = generated_arr.shape
            generated_arr += self.noise_sampler.generate()

        return generated_arr
872503
function() {
      var self = this;
      var url = null;

      // If no audio is available, quit immediately.
      if (Howler.noAudio) {
        self._emit('loaderror', null, 'No audio support.');
        return;
      }

      // Make sure our source is in an array.
      if (typeof self._src === 'string') {
        self._src = [self._src];
      }

      // Loop through the sources and pick the first one that is compatible.
      for (var i=0; i<self._src.length; i++) {
        var ext, str;

        if (self._format && self._format[i]) {
          // If an extension was specified, use that instead.
          ext = self._format[i];
        } else {
          // Make sure the source is a string.
          str = self._src[i];
          if (typeof str !== 'string') {
            self._emit('loaderror', null, 'Non-string found in selected audio sources - ignoring.');
            continue;
          }

          // Extract the file extension from the URL or base64 data URI.
          ext = /^data:audio\/([^;,]+);/i.exec(str);
          if (!ext) {
            ext = /\.([^.]+)$/.exec(str.split('?', 1)[0]);
          }

          if (ext) {
            ext = ext[1].toLowerCase();
          }
        }

        // Log a warning if no extension was found.
        if (!ext) {
          console.warn('No file extension was found. Consider using the "format" property or specify an extension.');
        }

        // Check if this extension is available.
        if (ext && Howler.codecs(ext)) {
          url = self._src[i];
          break;
        }
      }

      if (!url) {
        self._emit('loaderror', null, 'No codec support for selected audio sources.');
        return;
      }

      self._src = url;
      self._state = 'loading';

      // If the hosting page is HTTPS and the source isn't,
      // drop down to HTML5 Audio to avoid Mixed Content errors.
      if (window.location.protocol === 'https:' && url.slice(0, 5) === 'http:') {
        self._html5 = true;
        self._webAudio = false;
      }

      // Create a new sound object and add it to the pool.
      new Sound(self);

      // Load and decode the audio data for playback.
      if (self._webAudio) {
        loadBuffer(self);
      }

      return self;
    }