09-03-2010
Please post clearly what input you have and what output you expect, while using code tags. Recommending the people that should help you to play around with # and sed is maybe not very helpful. Did you trying to play with them so far?
Last edited by zaxxon; 09-03-2010 at 10:06 AM..
Reason: typo
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to replace the default home page for several mac user accounts, I wrote a script that will hunt the files down and replace them with a pre-configured set. The problem I am having is that the download destination path for the browser is hard coded into a .plist (text config file) file... (5 Replies)
Discussion started by: tret
5 Replies
2. Shell Programming and Scripting
Hi,
I have a file with the following contents
# Lines that start with a # are comments.
#
# Calling TOAD like this will perform a comparison from command line :
#
# "C:\Program Files\Quest Software\Toad for Oracle 9.6\toad.exe" -c... (2 Replies)
Discussion started by: rajan_san
2 Replies
3. Shell Programming and Scripting
Hi,
i call my shell like:
my_shell "my project name"
my script:
#!/bin/bash -vx
projectname=$1
sed s/'PROJECT_NAME ='/'PROJECT_NAME = '$projectname/ <test_config_doxy >temp
cp temp test_config_doxy
the following error occurres:
sed s/'PROJECT_NAME ... (2 Replies)
Discussion started by: vivelafete
2 Replies
4. Emergency UNIX and Linux Support
Guys I have a big issue that I need to get fixed ASAP however I can not seem to find a way to do it. We started to use zones with Solaris 10 at work and we moved a zone from a SIT box to a DEV box. Problem is the software we have installed is looking at a /lcl/sit/apps/ path and it needs to look... (5 Replies)
Discussion started by: LRoberts
5 Replies
5. Shell Programming and Scripting
Hi Fellows,
I am new to shell, please help we me out in this..
i have file which some lines like this..
$$param1='12-jan-2011'
$$param2='14-jan-2011'
$$param3='30-jan-2011'
.
.
.....so on..
I want to change $$param3 to '31-dec-2011'. i have variable which is storing(30-jan-2011 this... (1 Reply)
Discussion started by: victor369
1 Replies
6. Shell Programming and Scripting
Can someone tell me how I can do this?
e.g:
a=$(echo -e wert trewt ertert ertert ertert erttert
erterte
rterter
tertertert
ert)
How do i replace the STRING with $a?
I try this:
sed -i 's/STRING/'"$a"'/g' filename.ext
but this don' t work (2 Replies)
Discussion started by: jforce
2 Replies
7. Shell Programming and Scripting
HI ,
I can't find a solution to the following:
In a simple menu script I want to capture the input from the user with "read" and use it as a value in a variable Rempages="some_value" which is in a different script file.
So I have to perform a search and replace for this variable and only... (4 Replies)
Discussion started by: svetoslav_sj
4 Replies
8. Shell Programming and Scripting
Dear all,
I need your help, I have file like this:
file1:23456
01910964830098775635
34567
01942809546554654323
67589
26546854368698023653
09778
58716868568576876878
08675
86178546154065406546
08573
54165843543054354305
.
.file2:
23456 25
34567 26
67589 27 (2 Replies)
Discussion started by: attila
2 Replies
9. Shell Programming and Scripting
I have a file having some text like:
PATH_ABC=/user/myLocation
I have to replace "/user/myLocation" with a session variable say, $REPLACE_PATH,
where $REPLACE_PATH=/user/myReplaceLocation
The following sed command is not working. It is writing PATH_ABC=$REPLACE_PATH in the file
... (2 Replies)
Discussion started by: SKhan
2 Replies
10. Shell Programming and Scripting
Hi Folks -
I was wondering if you could help convert batch code in Linux? For instance, I use the following piece of code in DOS to find a file/executable, and then the FULL path as a variable.
::-- If startMaxl.exe exists, set full path --::
for %%D in (c d e f g h i j k l m n o p q r s t... (4 Replies)
Discussion started by: SIMMS7400
4 Replies
LEARN ABOUT CENTOS
set_volume_per_voice
set_volume_per_voice(3alleg4) Allegro manual set_volume_per_voice(3alleg4)
NAME
set_volume_per_voice - Sets the volume of a voice. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
void set_volume_per_voice(int scale);
DESCRIPTION
By default, Allegro will play a centered sample at half volume on both the left and right channel. A sample panned to the far right or left
will be played at maximum volume on that channel only. This is done so you can play a single panned sample without distortion. If you play
multiple samples at full volume, the mixing process can result in clipping, a noticeable form of distortion. The more samples, the more
likely clipping is to occur, and the more clipping, the worse the output will sound.
If clipping is a problem - or if the output is too quiet - this function can be used to adjust the volume of each voice. You should first
check that your speakers are at a reasonable volume, Allegro's global volume is at maximum (see set_volume() below), and any other mixers
such as the Windows Volume Control are set reasonably. Once you are sure that Allegro's output level is unsuitable for your application,
use this function to adjust it.
Each time you increase the parameter by one, the volume of each voice will halve. For example, if you pass 4, you can play up to 16 centred
samples at maximum volume without distortion.
If you pass 0 to this function, each centred sample will play at the maximum volume possible without distortion, as will all samples played
through a mono driver. Samples at the extreme left and right will distort if played at full volume. If you wish to play panned samples at
full volume without distortion, you should pass 1 to this function. Note: this is different from the function's behaviour in WIPs 3.9.34,
3.9.35 and 3.9.36. If you used this function under one of these WIPs, you will have to increase your parameter by one to get the same vol-
ume.
Note: The default behaviour has changed as of Allegro 4.1.15. If you would like the behaviour of earlier versions of Allegro, pass -1 to
this function. Allegro will choose a value dependent on the number of voices, so that if you reserve n voices, you can play up to n/2 nor-
malised samples with centre panning without risking distortion. The exception is when you have fewer than 8 voices, where the volume
remains the same as for 8 voices. Here are the values, dependent on the number of voices:
1-8 voices - set_volume_per_voice(2)
16 voices - set_volume_per_voice(3)
32 voices - set_volume_per_voice(4)
64 voices - set_volume_per_voice(5)
Of course this function does not override the volume you specify with play_sample() or voice_set_volume(). It simply alters the overall
output of the program. If you play samples at lower volumes, or if they are not normalised, then you can play more of them without distor-
tion.
It is recommended that you hard-code the parameter into your program, rather than offering it to the user. The user can alter the volume
with the configuration file instead, or you can provide for this with set_volume().
To restore volume per voice to its default behaviour, pass 1.
SEE ALSO
reserve_voices(3alleg4), set_volume(3alleg4), install_sound(3alleg4), detect_digi_driver(3alleg4), detect_midi_driver(3alleg4)
Allegro version 4.4.2 set_volume_per_voice(3alleg4)