⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 acmdialog.pas

📁 delphi编写的语音聊天代码
💻 PAS
字号:
unit ACMDialog;

interface

uses
  msacm,mmsystem,Windows, SysUtils, Classes, Controls, Dialogs;

type
  TACMDialog = class(TComponent)
  private
    { Private declarations }
  protected
    { Protected declarations }
  public
    function OpenDialog:pointer;
    { Public declarations }
  published
    { Published declarations }
  end;
var
fc:TACMFORMATCHOOSEA;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('Milos', [TACMDialog]);
end;

function TACMDialog.OpenDialog:Pointer;
var maxsizeformat,res:longint;
begin
  if fc.pwfx = nil then
  begin
   acmMetrics(0, ACM_METRIC_MAX_SIZE_FORMAT, MaxSizeFormat);
   fc.cbStruct := sizeof(fc);
   fc.cbWfx := MaxSizeFormat;
   getmem(fc.pwfx, MaxSizeFormat);  
   fc.pwfx.wFormatTag :=$31;   //WAVE_FORMAT_GSM610; set default format to GSM6.10
   fc.pwfx.nChannels := 1;     //mono
   fc.pwfx.nSamplesPerSec := 8000;  
   fc.pwfx.nAvgBytesPerSec:= 8000; { for buffer estimation }
   fc.pwfx.nBlockAlign:=1;      { block size of data }
   fc.pwfx.wbitspersample := 8;
  end;

  fc.fdwStyle:=ACMFORMATCHOOSE_STYLEF_INITTOWFXSTRUCT;  //use the pwfx(waveformatex structure) as default
  res:=acmFormatChoose(fc); //display the ACM dialog box
  result:=nil;
  if res=MMSYSERR_NOERROR then result:=fc.pwfx; //return the pointer to waveformatex structure

end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -