Recent

Author Topic: Playsound and altering volume  (Read 29340 times)

joyfulspring3

  • Guest
Re: Playsound and altering volume
« Reply #15 on: February 01, 2011, 04:16:21 pm »
Dear all, thank you.

Reading through these posts helps me feel supported before I undertake my next sound project which involves some dubbing and remixing. If I get stuck, I know where to ask my first question!! Great, thanks again,  8-)

w click

  • Full Member
  • ***
  • Posts: 205
Re: Playsound and altering volume
« Reply #16 on: February 01, 2011, 04:32:35 pm »
I can certianly help you with points 1 to 4, but can you help me with points 5 (mute) and 6 (position and length of wav)?

Fred vS

  • Hero Member
  • *****
  • Posts: 3919
    • StrumPract is the musicians best friend
Re: Playsound and altering volume
« Reply #17 on: February 01, 2011, 06:55:55 pm »
Hello everybody...
Sorry to come back but why dont you try the Bass library :
http://www.un4seen.com/
It works perfectly with Lazarus and do all what you want... ;D

I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

w click

  • Full Member
  • ***
  • Posts: 205
Re: Playsound and altering volume
« Reply #18 on: February 02, 2011, 12:34:45 pm »
Thanks for the pointer.  Much appreciated.  I had a look.

I really don't want to get involved in learning another library when I'm only two magic spells short of finishing.  Everything else, change volume for example, is only a screen's worth of code; I can't believe there isn't a solution somewhere.

w click

  • Full Member
  • ***
  • Posts: 205
Re: Playsound and altering volume
« Reply #19 on: February 02, 2011, 03:09:21 pm »
I've got this:-

Code: [Select]
function GetMasterMute(
  Mixer: hMixerObj;
  var Control: TMixerControl): MMResult;
  // Returns True on success
var
  Line: TMixerLine;
  Controls: TMixerLineControls;
begin
  ZeroMemory(@Line, SizeOf(Line));
  Line.cbStruct := SizeOf(Line);
  Line.dwComponentType := MIXERLINE_COMPONENTTYPE_DST_SPEAKERS;
  Result := mixerGetLineInfo(Mixer, @Line,
    MIXER_GETLINEINFOF_COMPONENTTYPE);
  if Result = MMSYSERR_NOERROR then
  begin
    ZeroMemory(@Controls, SizeOf(Controls));
    Controls.cbStruct := SizeOf(Controls);
    Controls.dwLineID := Line.dwLineID;
    Controls.cControls := 1;
    Controls.dwControlType := MIXERCONTROL_CONTROLTYPE_MUTE;
    Controls.cbmxctrl := SizeOf(Control);
    Controls.pamxctrl := @Control;
    Result := mixerGetLineControls(Mixer, @Controls,
      MIXER_GETLINECONTROLSF_ONEBYTYPE);
  end;
end;                 

Which compiles fine, but I've no idea how to call the function.

w click

  • Full Member
  • ***
  • Posts: 205
Re: Playsound and altering volume
« Reply #20 on: February 02, 2011, 03:46:29 pm »
I can set the mute now, I found a page on the internet with some example code that worked!!!  Sadly I don't know why because it was all in a language I couldn't even identify.  Thank goodness the reserved words are in English.

I just need to call this:-

function GetMasterMute(
  Mixer: hMixerObj;
  var Control: TMixerControl): MMResult;

Mixer is probably just "0", but the rest...                                       

 

TinyPortal © 2005-2018