Sometimes we NEED one of the noise elements.
555145
function search_noise($text)
	{
        global $debug_object;
        if (is_object($debug_object)) {
            $debug_object->debug_log_entry(1);
        }

        foreach ($this->noise as $noiseElement) {
            if (strpos($noiseElement, $text) !== false) {
                return $noiseElement;
            }
        }
        return false;
	}
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
81160
def validate_sound(sound,
                   token):
    '''
    
    '''
    ret = {
            'message': 'Sound is invalid',
            'res': False
           }
    parameters = dict()
    parameters['token'] = token

    response = query(function='validate_sound',
                     method='GET',
                     query_params=parameters)

    if response['res']:
        if 'message' in response:
            _message = response.get('message', '')
            if 'status' in _message:
                if _message.get('dict', {}).get('status', '') == 1:
                    sounds = _message.get('dict', {}).get('sounds', '')
                    if sound in sounds:
                        ret['message'] = 'Valid sound {0}.'.format(sound)
                        ret['res'] = True
                    else:
                        ret['message'] = 'Warning: {0} not a valid sound.'.format(sound)
                        ret['res'] = False
                else:
                    ret['message'] = ''.join(_message.get('dict', {}).get('errors'))
    return ret
701563
function onHidden() {
    bus.sounds.forEach(sound => {
        if (sound.playing) {
            sound.pause();
            pageHiddenPaused.push(sound);
        }
    });
}
941186
function soundLoadError(sound_name, onerror_cb) {
         // check the retry counter
         if (retry_counter++ > 3) {
           // something went wrong
           var errmsg = "melonJS: failed loading " + sound_name;

           if (me.sys.stopOnAudioError === false) {
             // disable audio
             me.audio.disable(); // call error callback if defined

             if (onerror_cb) {
               onerror_cb();
             } // warning


             console.log(errmsg + ", disabling audio");
           } else {
             // throw an exception and stop everything !
             throw new Error(errmsg);
           } // else try loading again !

         } else {
           audioTracks[sound_name].load();
         }
       }
887963
def create_noise(length, level=4):
    """"""
    noise = bytearray(length)
    adjust = 128 - int(level / 2)
    i = 0
    while i < length:
        v = random.randint(0, 256)
        noise[i] = v % level + adjust
        i += 1
    return noise
1359160
public void setAmbient(float gray){
        ambient[0]=gray;
        ambient[1]=gray;
        ambient[2]=gray;
        Am = true;
    }
1203646
function() {
        if (!this.quiet()) {
            var hr = [];
            for (var i = 0; i < 79; i++) {
                hr[i] = "-";
            }
            console.log(this._callerInfo() + this._getIndent() + hr.join("").green);
        }
    }
1012891
def add_noise_to_dict_values(dictionary: Dict[A, float], noise_param: float) -> Dict[A, float]:
    
    new_dict = {}
    for key, value in dictionary.items():
        noise_value = value * noise_param
        noise = random.uniform(-noise_value, noise_value)
        new_dict[key] = value + noise
    return new_dict
1069772
def gaussian_noise(in_features, out_features, device):
    
    return torch.randn((in_features, out_features), device=device), torch.randn(out_features, device=device)
901597
def note_off(self, channel, note, velocity):
        """"""
        return self.midi_event(NOTE_OFF, channel, note, velocity)
1347925
function(id) {
            if (!Crafty.support.audio) return;
            var c;
            for (var i in this.channels) {
                c = this.channels[i];
                if ((!id && c.active) || c._is(id)) {
                    c.active = false;
                    c.obj.pause();
                }
            }
            return;
        }
548745
function() {
		this.context = new AudioContext();
		this.sampleRate = this.context.sampleRate;
		this.gainNode = this.context.createGain();
		this.gainNode.connect( this.context.destination );
	}
1358545
function NoiseSampler(size) {
        if (!size)
            throw "no size specified to NoiseSampler";

        this.size = size;   
        this.scale = 1;
        this.offset = 0;
        this.smooth = true;
        this.seamless = false;

        // this.scales = [
        //     10, 0.1, 0.2, 1
        // ];
        // this.strengths = [
        //     0.1, 0.3, 0.2, 1
        // ];
        
        this.scales = [
            1, 20, 0.5
        ];
        this.strengths = [
            1, 0.1, 0.5
        ];

        this.data = new Float32Array(this.size * this.size);
}
495505
def _sound_settings(area, setting, value, validate_value):
        """"""
        if validate_value:
            if (setting in CONST.VALID_SOUND_SETTINGS
                    and value not in CONST.ALL_SETTING_SOUND):
                raise AbodeException(ERROR.INVALID_SETTING_VALUE,
                                     CONST.ALL_SETTING_SOUND)
            elif (setting == CONST.SETTING_ALARM_LENGTH
                  and value not in CONST.ALL_SETTING_ALARM_LENGTH):
                raise AbodeException(ERROR.INVALID_SETTING_VALUE,
                                     CONST.ALL_SETTING_ALARM_LENGTH)
            elif (setting == CONST.SETTING_FINAL_BEEPS
                  and value not in CONST.ALL_SETTING_FINAL_BEEPS):
                raise AbodeException(ERROR.INVALID_SETTING_VALUE,
                                     CONST.ALL_SETTING_FINAL_BEEPS)

        return {'area': area, setting: value}
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;
    }
987558
function () {
    var el = this.el;
    var i;
    var sceneEl = el.sceneEl;
    var self = this;
    var sound;

    if (this.pool.children.length > 0) {
      this.stopSound();
      el.removeObject3D('sound');
    }

    // Only want one AudioListener. Cache it on the scene.
    var listener = this.listener = sceneEl.audioListener || new THREE.AudioListener();
    sceneEl.audioListener = listener;

    if (sceneEl.camera) {
      sceneEl.camera.add(listener);
    }

    // Wait for camera if necessary.
    sceneEl.addEventListener('camera-set-active', function (evt) {
      evt.detail.cameraEl.getObject3D('camera').add(listener);
    });

    // Create [poolSize] audio instances and attach them to pool
    this.pool = new THREE.Group();
    for (i = 0; i < this.data.poolSize; i++) {
      sound = this.data.positional
        ? new THREE.PositionalAudio(listener)
        : new THREE.Audio(listener);
      this.pool.add(sound);
    }
    el.setObject3D(this.attrName, this.pool);

    for (i = 0; i < this.pool.children.length; i++) {
      sound = this.pool.children[i];
      sound.onEnded = function () {
        this.isPlaying = false;
        self.el.emit('sound-ended', self.evtDetail, false);
      };
    }
  }