Change the volume of gen by dB decibles
973449
def volume(gen, dB=0):
	''''''
	if not hasattr(dB, 'next'):
		# not a generator
		scale = 10 ** (dB / 20.)
	else:
		def scale_gen():
			while True:
				yield 10 ** (next(dB) / 20.)
		scale = scale_gen()
	return envelope(gen, scale)
717375
function onVolumeKeydown(event) {
		const { keyCode, shiftKey } = event;

		// 37: LEFT, 38: UP, 39: RIGHT, 40: DOWN
		if (37 <= keyCode && 40 >= keyCode) {
			event.preventDefault();

			const isLTR = /^(btt|ltr)$/.test(volumeDir);
			const offset = 37 === keyCode || 39 === keyCode ? keyCode - 38 : isLTR ? 39 - keyCode : keyCode - 39;

			media.volume = Math.max(0, Math.min(1, media.volume + offset * (isLTR ? 0.1 : -0.1) * (shiftKey ? 1 : 0.2)));
		}
	}
540757
def volume(action,value=30)
      cmd =
      case action
      when :up then "volume 1"
      when :down then "volume 0"
      when :set then "volume #{value} 1"
      else return false
      end
      resp = command cmd, /Volume/
      resp.gsub("Volume: ","").gsub(" %\n","")
    end
1284666
def set_volume(self, volume):
        
        volume = min(max(0, volume), 1)
        self.logger.info("Receiver:setting volume to %.1f", volume)
        self.send_message({MESSAGE_TYPE: 'SET_VOLUME',
                           'volume': {'level': volume}})
        return volume
757531
def update_volume(self, volumeID, metadata):
        '''
        '''
        log.debug('updating volume metadata: {}'.format(volumeID))
        rawVolume = self._req_raw_volume(volumeID)
        normalized = self.normalize_volume(rawVolume)
        normalized['metadata'] = metadata
        _, newRawVolume = self.denormalize_volume(normalized)
        self._db.modify_book(volumeID, newRawVolume)
712539
def rmgen(self, idx):
        
        stagens = []
        for device, stagen in zip(self.devman.devices, self.call.stagen):
            if stagen:
                stagens.append(device)
        for gen in idx:
            for stagen in stagens:
                if gen in self.__dict__[stagen].uid.keys():
                    self.__dict__[stagen].disable_gen(gen)
1276704
async def sound(dev: Device, target, value):
    """"""
    if target and value:
        click.echo("Setting %s to %s" % (target, value))
        click.echo(await dev.set_sound_settings(target, value))

    print_settings(await dev.get_sound_settings())
147382
def write_volume(self):
        """"""
        # Update the volume
        data = datatools.get_data()
        data["discord"]["servers"][self.server_id][_data.modulename]["volume"] = self.volume
        datatools.write_data(data)
532856
def update_default_output_dir(self):
        """"""
        if self.scenario_directory_radio.isChecked():
            self.output_directory.setText(self.source_directory.text())
965318
def volume(self, value=None):
        """"""
        mass = vtk.vtkMassProperties()
        mass.SetGlobalWarningDisplay(0)
        mass.SetInputData(self.polydata())
        mass.Update()
        v = mass.GetVolume()
        if value is not None:
            if not v:
                colors.printc("~bomb Volume is zero: cannot rescale.", c=1, end="")
                colors.printc(" Consider adding actor.triangle()", c=1)
                return self
            self.scale(value / v)
            return self
        else:
            return v
335069
def set_volume(self, mute=False, volume=50):
        """"""
        self.publish(
            action='set',
            resource='cameras/{}'.format(self.device_id),
            publish_response=False,
            properties={'speaker': {'mute': mute, 'volume': volume}}
        )
901363
def _convert_volume(self, volume):
        
        data = {
            'host': volume.get('hostPath'),
            'container': volume.get('containerPath'),
            'readonly': volume.get('mode') == 'RO',
        }
        return data
365054
def set_volume(percentage):
	'''
	'''

	if percentage > 100 or percentage < 0:
		raise ValueError('percentage must be an integer between 0 and 100')

	if system.get_name() == 'windows':
		# TODO: Implement volume for Windows. Looks like WinAPI is the
		# solution...
		pass

	elif system.get_name() == 'mac':
		# OS X uses 0-10 instead of percentage
		volume_int = percentage / 10

		sp.Popen(['osascript', '-e', 'set Volume %d' % volume_int]).wait()

	else:
		# Linux/Unix
		formatted = str(percentage) + '%'
		sp.Popen(['amixer', '--quiet', 'sset', 'Master', formatted]).wait()
843891
def gen(name, data):
        """"""
        return '---- dataentry %s ----\n%s\n----' % (name, '\n'.join(
            '%s:%s' % (attr, value) for attr, value in data.items()))
132294
def synthesize(self, modules, use_string, x64, native):
        """"""
        # code_opts = CodeOpts(
        #     str.lower, None if use_string else hash_func,
        #     'reloc_delta', '->',
        #     True)
        # gen_opts = GenOpts('defs', transformed)
        print(hash_func)
        groups = group_by(modules, ends_with_punctuation)
        sources = self.make_source(groups, self.database)
        if sources:
            return stylify_files(
                {'defs.h': sources[0], 'init.c': sources[1]}
            )
        else:
            return ''
660433
function changeSample() {
    document.getElementById('play').disabled = true;
    document.getElementById('stop').disabled = true;
    soundUrl = document.getElementById("sample_no").value;
    if (typeof sound != 'undefined' && sound.isPlaying) {
        sound.stop(0);
        sound.isPlaying = false;
    }
    loader_sound = new ambisonics.HOAloader(context, maxOrder, soundUrl, assignSoundBufferOnLoad);
    loader_sound.load();
}
772156
def volume_up(self, delta=0.1):
        
        if delta <= 0:
            raise ValueError(
                "volume delta must be greater than zero, not {}".format(delta))
        return self.set_volume(self.status.volume_level + delta)