Home
Top.Mail.Ru Yandeks.Metrika
Forum: "Main";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Down

DelphiX_play Find similar branches


XeN   (2001-12-21 11:21) [0]

Кто знает как в DelphiX сделать стерео эффект проигрывания звука.



3d[Power]   (2001-12-21 11:29) [1]

this procedure is (с) 3d[Power] for NFK game.

const opt_stereo : boolean = true;
opt_sound : boolean = true;
opt_channelapproach : byte = 10;
opt_reversestereo : boolean = false;

procedure PLAYSOUND(filename : shortstring;x : real);
var PanFactor, PanValue : Double;
begin
if OPT_SOUND = false then exit;
if OPT_STEREO = true then begin
PanFactor := 31.25; // 10000 is the panning range
PanValue := ((round(X) * PanFactor)-10000) / OPT_CHANNELAPPROACH;
if OPT_REVERSESTEREO then PanValue := -panvalue;
end else panvalue := 0;
try
WaveLst.Items.Find(filename).Pan := round(Panvalue);
WaveLst.Items.Find(filename).Play(False);
except
AddMessage("Error playing sound ""+filename+""");
end;
end;

короче playsound("your filename in dxwavelist", 320) - в центре.
короче playsound("your filename in dxwavelist", 0) - слева.
короче playsound("your filename in dxwavelist", 640) - справа.
Можешь регулировать степень стерео эффекта :)



Pages: 1 whole branch

Forum: "Main";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Top















Memory: 0.81 MB
Time: 0.029 c
1-22121
stalin
2001-12-18 00:20
2002.01.08
New problem: + (


3-21958
bk
2001-12-05 19:15
2002.01.08
Pomogite kto moget ado unikal nomer


4-22455
Maamed
2001-10-31 10:13
2002.01.08
Activate another program window


14-22354
Nemesis
2001-10-08 13:02
2002.01.08
Mobile


1-22196
T2
2001-12-16 07:18
2002.01.08
Desktop off





afrikaans albanian Arabic armenian azerbaijani basque belarusian bulgarian catalan Chinese (Simplified) Chinese (Traditional) croatian Czech danish Dutch English estonian filipino finnish French
galician georgian German greek haitian Creole hebrew Hindi hungarian icelandic indonesian Irish italian japanese Korean latvian lithuanian macedonian malay maltese norwegian
persian polish portuguese Romanian russian serbian slovak Slovenian Español swahili Swedish thai turkish Ukrainian urdu vietnamese welsh yiddish bengali bosnian
cebuano Esperanto gujarati hausa hmong igbo javanese kannada khmer lao latin maori marathi mongolian nepali punjabi somali tamil telugu yoruba
zulu
English French German Italian Portuguese Russian Spanish