format mplayer's volume
542099
def _format_volume_string(self, volume_string):
        
        return '[' + volume_string[volume_string.find(self.volume_string):].replace(' %','%').replace('ume', '')+'] '
1149305
def vectorize_raw(audio: np.ndarray) -> np.ndarray:
    """"""
    if len(audio) == 0:
        raise InvalidAudio('Cannot vectorize empty audio!')
    return vectorizers[pr.vectorizer](audio)
292472
private static ByteBuffer convertAudioBytes(AudioFormat format, byte[] audio_bytes, boolean two_bytes_data) {
		ByteBuffer dest = ByteBuffer.allocateDirect(audio_bytes.length);
		dest.order(ByteOrder.nativeOrder());
		ByteBuffer src = ByteBuffer.wrap(audio_bytes);
		src.order(ByteOrder.BIG_ENDIAN);
		if (two_bytes_data) {
			ShortBuffer dest_short = dest.asShortBuffer();
			ShortBuffer src_short = src.asShortBuffer();
			while (src_short.hasRemaining())
				dest_short.put(src_short.get());
		} else {
			while (src.hasRemaining()) {
				byte b = src.get();
				if (format.getEncoding() == Encoding.PCM_SIGNED) {
					b = (byte) (b + 127);
				}
				dest.put(b);
			}
		}
		dest.rewind();
		return dest;
	}
1044562
def _format_index(self, volume_system, idx):
        """"""

        if volume_system.parent.index is not None:
            return '{0}.{1}'.format(volume_system.parent.index, idx)
        else:
            return str(idx)
428478
function audioExt (name) {
  var ext = path.extname(name)
  return ['.wav', '.ogg', '.mp3'].indexOf(ext) > -1 ? ext : null
}
154985
def _volume_command(ramp, volume):
    
    if volume is not None:
        ramp.set_volume(float(volume))
    else:
        print ramp.volume
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)));
		}
	}
345483
def append_volume(runtime, source, target, writable=False):
        # type: (List[Text], Text, Text, bool) -> None
        """"""
        runtime.append(u"--volume={}:{}:{}".format(
            docker_windows_path_adjust(source), target,
            "rw" if writable else "ro"))
45631
def format_ffmpeg_filter(name, params):
  
  return "%s=%s" % (name,
                    ":".join("%s=%s" % (k, v) for k, v in params.items()))
755049
def increase_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':
		volume_int = percentage / 10
		old_volume = get()

		new_volume = old_volume + volume_int

		if new_volume > 10:
			new_volume = 10

		set_volume(new_volume * 10)

	else:
		# Linux/Unix
		formatted = '%d%%+' % percentage
		# + or - increases/decreases in amixer

		sp.Popen(['amixer', '--quiet', 'sset', 'Master', formatted]).wait()
405090
def cli(env, volume_id, sortby, columns):
    """"""
    block_manager = SoftLayer.BlockStorageManager(env.client)
    snapshots = block_manager.get_block_volume_snapshot_list(
        volume_id,
        mask=columns.mask()
    )

    table = formatting.Table(columns.columns)
    table.sortby = sortby

    for snapshot in snapshots:
        table.add_row([value or formatting.blank()
                       for value in columns.row(snapshot)])

    env.fout(table)
1245729
def enable_audio_video_cmd(param, enable):
    """"""
    cmd = 'configManager.cgi?action=setConfig'
    formats = [('Extra', 3), ('Main', 4)]
    if param == 'Video':
        formats.append(('Snap', 3))
    for fmt, num in formats:
        for i in range(num):
            cmd += '&Encode[0].{}Format[{}].{}Enable={}'.format(
                fmt, i, param, str(enable).lower())
    return cmd
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
419289
def chunk_audio_pieces(self, pieces, chunk_size):
        """"""
        left_over = np.array([])
        for piece in pieces:
            if left_over.size == 0:
                combined = piece
            else:
                combined = np.concatenate([left_over, piece], axis=-1)
            for chunk in chunk_audio(combined.T, chunk_size):
                yield chunk.T
            left_over = piece[-(len(piece) % chunk_size):]
290595
def format(self, object, context, maxlevels, level):
        
        return _safe_repr(object, context, maxlevels, level)
44144
async def volume(self, ctx, volume: int):
        """"""

        if ctx.voice_client is None:
            return await ctx.send("Not connected to a voice channel.")

        ctx.voice_client.source.volume = volume / 100
        await ctx.send("Changed volume to {}%".format(volume))
44575
def libvlc_media_get_mrl(p_md):
    '''
    '''
    f = _Cfunctions.get('libvlc_media_get_mrl', None) or \
        _Cfunction('libvlc_media_get_mrl', ((1,),), string_result,
                    ctypes.c_void_p, Media)
    return f(p_md)