-=-
.
.....
  
 
RSS
Direkomendasikan menggunakan brower Opera/Chrome/Firefox. Resolusi minimal 1024x768 | Powered by ____ |
 
  
 
Nikmati Delphi-ID dalam berbagai versi tampilan :
Basic View (LOW Bandwidth)
Default View (Full)
Mobile Edition
Main Menu
..:: onWebTools ::..
..:: onLastPosts ::..
goto Postjumlah komponen maksimal dalam sebuah project(6)
 by d4mnf1y32
 on 21.May at 12:16
goto Posttanya grayscale to biner dengan scanline(1)
 by luckynvic
 on 20.May at 20:44
goto Posttanya looping biner to matriks(1)
 by luckynvic
 on 20.May at 20:10
goto Postsql error:acces denied for user....(2)
 by nasbms
 on 19.May at 16:54
goto Postpemanggilan frame(4)
 by nasbms
 on 19.May at 16:14
goto Posttanya AvLock(0)
 by azuriza
 on 19.May at 11:24
goto PostGet TDBEdit Value Menggunakan LookUp Grid(10)
 by henry_sys
 on 18.May at 11:27
goto Postmenghitung record dalam perulangan(4)
 by idhiel
 on 16.May at 13:53
goto Posttanya ascii(4)
 by mas_kofa
 on 16.May at 12:11
goto PostRawPrint Untuk Delphi XE2(0)
 by adewijaya
 on 15.May at 22:34
goto Postdatabase error..(4)
 by idhiel
 on 15.May at 15:57
goto Postbekasi, pt arila putra mahkota(3)
 by mas_kofa
 on 15.May at 15:37
goto Postbagaimana cara membaca file *.doc dg delphi?(0)
 by ficky
 on 15.May at 06:14
goto Posttanya biner to matriks(13)
 by diandewi
 on 14.May at 20:30

..:: onLast Articles ::..
..:: New Download ::..
Pascal-id.Org
Feeds -  Popular -  Latest
RE: The Longue
8 months, 3 weeks ago
RE: belajar pascal
8 months, 3 weeks ago
RE: The Longue
8 months, 3 weeks ago
RE: belajar pascal
8 months, 3 weeks ago
RE: Perkenalan dan Absen
8 months, 3 weeks ago
RE: Alhamdulillah Buka Puasa Bersama
8 months, 4 weeks ago
RE: تَقَبَّلَ اللهُ مِنَّا وَمِنْكَ - Selamat Hari Raya Idul Fitri
8 months, 4 weeks ago
Lintas Situs
«
free web site stats and visitor tracking

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
clarkOffline
Location: Singkawang
Post subject: Membuat Peak Level Meter  PostPosted: 02/Mar/2006 15:28
onIntermediate


Joined: 03-Dec-2005
Posts: 55

Status: Offline
Hi.. Saya Mau membuat media player yang ada Peak Level Meternya.. ada yang tau ga..?
 
 View user's profile Send private message  
Reply with quote Back to top
madiOffline
Location:
Post subject:   PostPosted: 17/Jul/2007 22:53
onProfessional


Joined: 30-Dec-2005
Posts: 527

Status: Offline
silahkan dicoba...script ini error di komp saya...klo2 di komp sampeyan bisa...Very Happy

{
Every line going into and out of the mixer has a number of "controls"
associated with it. Some of those controls are "meters," which give
you a real-time value of the sound level on the corresponding line.
Not all lines have meter controls, and not all sound cards provide
support for meters.

Here's some code that will retrieve a handle to the meter attached to
the WaveOut source of the speaker line, if there is one:
}
code : pascal
  1. uses
  2. MMSystem;
  3.  
  4. procedure TForm1.Button1Click(Sender: TObject);
  5. var
  6. MixerControl: TMixerControl;
  7. MixerControlDetails: TMixerControlDetails;
  8. MixerControlDetailsSigned: TMixerControlDetailsSigned;
  9. Mixer: THandle;
  10. MixerLine: TMixerLine;
  11. MixerLineControls: TMixerLineControls;
  12. PeakMeter: DWORD;
  13. Rslt: DWORD;
  14. SourceCount: Cardinal;
  15. WaveOut: DWORD;
  16. I: Integer;
  17. X: Integer;
  18. Y: Integer;
  19. begin
  20. Rslt := mixerOpen(@Mixer, 0, 0, 0, 0);
  21. if Rslt <> 0 then
  22. raise Exception.CreateFmt('Can''t open mixer (%d)', [Rslt]);
  23. FillChar(MixerLine, SizeOf(MixerLine), 0);
  24. MixerLine.cbStruct := SizeOf(MixerLine);
  25. MixerLine.dwComponentType := MIXERLINE_COMPONENTTYPE_DST_SPEAKERS;
  26. Rslt := mixerGetLineInfo(Mixer, @MixerLine,
  27. MIXER_GETLINEINFOF_COMPONENTTYPE);
  28. if Rslt <> 0 then
  29. raise Exception.CreateFmt('Can''t find speaker line (%d)', [Rslt]);
  30. SourceCount := MixerLine.cConnections;
  31. WaveOut := $FFFFFFFF;
  32. for I := 0 to SourceCount - 1 do
  33. begin
  34. MixerLine.dwSource := I;
  35. Rslt := mixerGetLineInfo(Mixer, @MixerLine,
  36. MIXER_GETLINEINFOF_SOURCE);
  37. if Rslt <> 0 then
  38. raise Exception.CreateFmt('Can''t get source line (%d)', [Rslt]);
  39. if MixerLine.dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT then
  40. begin
  41. WaveOut := MixerLine.dwLineId;
  42. Break;
  43. end;
  44. end;
  45. if WaveOut = $FFFFFFFF then
  46. raise Exception.Create('Can''t find wave out device');
  47. FillChar(MixerLineControls, SizeOf(MixerLineControls), 0);
  48. with MixerLineControls do
  49. begin
  50. cbStruct := SizeOf(MixerLineControls);
  51. dwLineId := WaveOut;
  52. dwControlType := MIXERCONTROL_CONTROLTYPE_PEAKMETER;
  53. cControls := 1;
  54. cbmxctrl := SizeOf(TMixerControl);
  55. pamxctrl := @MixerControl;
  56. end;
  57. Rslt := mixerGetLineControls(Mixer, @MixerLineControls,
  58. MIXER_GETLINECONTROLSF_ONEBYTYPE);
  59. if Rslt <> 0 then
  60. raise Exception.CreateFmt('Can''t find peak meter control (%d)',
  61. [Rslt]);
  62. PeakMeter := MixerControl.dwControlID;
  63.  
  64. // at this point, I have the meter control ID, so I can
  65. // repeatedly query its value and plot the resulting data
  66. // on a canvas
  67.  
  68. X := 0;
  69. FillChar(MixerControlDetails, SizeOf(MixerControlDetails), 0);
  70. with MixerControlDetails do
  71. begin
  72. cbStruct := SizeOf(MixerControlDetails);
  73. dwControlId := PeakMeter;
  74. cChannels := 1;
  75. cbDetails := SizeOf(MixerControlDetailsSigned);
  76. paDetails := @MixerControlDetailsSigned;
  77. end;
  78. repeat
  79. Sleep(10);
  80. Rslt := mixerGetControlDetails(Mixer, @MixerControlDetails,
  81. MIXER_GETCONTROLDETAILSF_VALUE);
  82. if Rslt <> 0 then
  83. raise Exception.CreateFmt('Can''t get control details (%d)',
  84. [Rslt]);
  85. Application.ProcessMessages;
  86. Inc(X);
  87. Y := 300 - Round(300 * Abs(MixerControlDetailsSigned.lValue) / 32768);
  88. with Canvas do
  89. begin
  90. MoveTo(X, 0);
  91. Pen.Color := clBtnFace;
  92. LineTo(X, 300);
  93. Pen.Color := clWindowText;
  94. LineTo(X, Y);
  95. end;
  96. until X > 500;
  97.  
  98. // don't forget to close the mixer handle when you're done
  99.  
  100. Rslt := mixerClose(Mixer);
  101. if Rslt <> 0 then
  102. raise Exception.CreateFmt('Can''t close mixer (%d)', [Rslt]);
  103. end;
Parsed in 0.020 seconds, using GeSHi
 
 View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic





Powered by PNphpBB2 © 2003-2009 The Zafenio Team
Credits


| Register | Lost Password ? |