Jump to content
ELFORUM - Forumul Electronistilor
Sign in to follow this  
satelit

CONTROLUL VOLUMULUI (up-down) LA PLACA DE SUNET

Recommended Posts

Am construit un player in C++Builder si as vrea sa-i controlez si sunetul (volume up-down).Am vazut pe net (la msdn) ca acest lucru se poate face cu functii API ,numai ce nu stiu cum sa implementez aceste functii in C++Builder.Am incercat cu libraria fmod care este pentru Visual C++ si imi spune ca nu am rezolvat problema intre program si driver-ul placii de sunet. Tot de la msdn am luat functii pentru comanda unui CD-ROM (eject,open,stop,play pentru audio) care le-am implementat in C++Builder si au mers.Aceste functii sunt de forma:mciSendString("Play CDAudio\0", chrRc, sizeof(chrRc), NULL);etc.Dca aveti idei cum sa implementez functiile placii de sunet in C++Builder sau alte modalitati de control al sunetului rog VA ROG SA MA AJUTATI.VA MULTUMESC.

Share this post


Link to post
Share on other sites

nu am Builder instalat, dar in Delphi poti face asa:

 

procedure TForm1.Button1Click(Sender: TObject);var  WaveCaps: TWaveOutCaps;  Volume: Byte;  Res:integer;beginWaveOutGetDevCaps(0,@WaveCaps,SizeOf(WaveCaps)); if WaveCaps.dwSupport and WAVECAPS_VOLUME <> 0 then begin Volume:=200; // Volume from 0 to 255  Res:=((Volume shl 8) or (Volume shl 24));      // Both channels - ((Volume shl 8) or (Volume shl 24));      // Left channel  - (Volume or (Volume shl 8));      // Right channel - ((Volume shl 16) or (Volume shl 24));  WaveOutSetVolume(0,Res);end;end;

si inainte bagi

uses mmsystem;
ca sa-ti recunoasca functiile

 

Probabil ca foarte asemanator se face si in C Builder, doar ca se schimba din pascal in c++. Incearca.

 

Codul de mai sus iti schimba volumul la Wave out.

Share this post


Link to post
Share on other sites

Poti folosi functiile:mixerClose mixerGetControlDetails mixerGetDevCaps mixerGetID mixerGetLineControls mixerGetLineInfo mixerGetNumDevs mixerMessage mixerOpen mixerSetControlDetailsIn MSDN ar trebui sa fie si un exmplu de utilizare.

Share this post


Link to post
Share on other sites

Asta caut si eu un exemplu de utilizare al functiilor de la msdn,sunt sigur ca cu aceste functii merge pentru ca le-am mai folosit la CD-ROM.

 

Nu are treaba cu PIC-uri.

Nu mai posta aiurea

Mutat la SOFTWARE

Sofian

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.