Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2005.02.27;
Скачать: CL | DM;

Вниз

Как управлять балансом звука из моей программы   Найти похожие ветки 

 
AlexLine   (2004-11-09 16:58) [0]

Уважаемые знатоки. Как управлять балансом звука из программы?

Заранее благодарю

Александр


 
programania ©   (2004-11-09 21:01) [1]


Vol:record
   case Integer of
   0: (LongVolume: Longint);
   1: (LeftVolume,
       RightVolume : Word);
   end;

PROCEDURE volIni;
var
WaveOutCaps : TWaveOutCaps;
I           : Integer;
begin
FDevice:= -1;
for I := 0 to waveOutGetNumDevs - 1 do begin
 waveOutGetDevCaps(I, @WaveOutCaps, SizeOf(WaveOutCaps));
 if (WaveOutCaps.dwSupport and WAVECAPS_VOLUME) <> 0 then begin
   FDevice := I; break;
 end;
end;
end;

PROCEDURE setVolume(Volume,balans:integer);
//balans=-100..+100  0=одинаково
//volume=0..255;
begin
if FDevice>=0 then begin
Vol.LeftVolume := Volume shl 8* (100+balans) div 100;
Vol.RightVolume :=Volume shl 8* (100-balans) div 100;
waveOutSetVolume(FDevice, Vol.LongVolume);
end;
end;

FUNCTION getVolume: Byte;
begin
if FDevice>=0 then begin
waveOutGetVolume(FDevice, @Vol.LongVolume);
result := (Vol.LeftVolume + Vol.RightVolume) shr 9;
end
else result:=0;
end;


Хотя я управляю через BASS:
BASS_ChannelSetAttributes(chan,-1,-100,pan);



Страницы: 1 вся ветка

Текущий архив: 2005.02.27;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.025 c
14-1107525215
Hypercube
2005-02-04 16:53
2005.02.27
KOffice и Quanta Plus


14-1107237517
Vlad Oshin
2005-02-01 08:58
2005.02.27
Досуг, свободное время, хобби и т.п.


1-1108447358
ТехникПТО
2005-02-15 09:02
2005.02.27
Продолжите плиз...


14-1107851666
Vlad Oshin
2005-02-08 11:34
2005.02.27
Поставлю памятник автору Radminов! и Вопрос


14-1107759179
KSergey
2005-02-07 09:52
2005.02.27
Книжки по С++