BaLaNs dzwięku

0

Otóż tworzę odtwarzacz multimediów. Mam trackbar'a do regulacji balansu; czyli w którym głośniku będzie głośniej itp. no i...
Jak to zrobić ?

0

Jak odtwarzasz? TMediaPlayer czy inaczej? Więcej szczegółów by się przydało.

0

Tak MediaPlayer. Na głośność już mam:

TrackBar.Max:=15;
zmien:=(TrackBar.Max-round(TrackBar.Position))*$11111111;
WaveOutSetVolume(0, zmien)

Teraz potrzebuję na balans pomiędzy głośnikami.

0

ech... nawet nie poszukales...

MSDN:

waveOutSetVolume
This function sets the volume of a waveform output device.

MMRESULT waveOutSetVolume(
HWAVEOUT hwo,
DWORD dwVolume
);
Parameters
hwo
Handle to an open waveform-audio output device. This parameter can also be a device identifier.
dwVolume
Specifies a new volume setting. The low-order word contains the left-channel volume setting, and the high-order word contains the right-channel setting. A value of 0xFFFF represents full volume, and a value of 0x0000 is silence.
If a device does not support both left and right volume control, the low-order word of dwVolume specifies the volume level, and the high-order word is ignored.

czyli:

waveOutSetVolume(0, MAKELONG(lewy, prawy));

teraz ciut matematyki i masz balans...

[browar]

1 użytkowników online, w tym zalogowanych: 0, gości: 1