agape
27-01-07, 09:01
Witam mam problem bo niewiem jak ustawic format nagrywania pliku wave automatycznie mi sie ustawia na mniejszy niz bym chcial, mozna oczywiscie zmienic format przy uruchomieniu programu na wiekszy ale potrzebne mi zeby format byl ustalony odgornie na wyzszy
zrodlo:
unit Main;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, WaveIn, WaveRecorders, WaveIO, WaveOut,
WavePlayers, StdCtrls, Buttons, ExtCtrls, mmSystem, WaveUtils;
type
TMainForm = class(TForm)
btnRecord: TBitBtn;
btnStop: TBitBtn;
WaveFile: TLabel;
StockAudioPlayer: TStockAudioPlayer;
StockAudioRecorder: TStockAudioRecorder;
Format: TComboBox;
procedure FormCreate(Sender: TObject);
procedure FormatChange(Sender: TObject);
procedure btnRecordClick(Sender: TObject);
procedure btnStopClick(Sender: TObject);
end;
var
MainForm: TMainForm;
implementation
{$R *.dfm}
procedure TMainForm.FormCreate(Sender: TObject);
var
pcm: TPCMFormat;
WaveFormatEx: TWaveFormatEx;
begin
for pcm := Succ(Low(TPCMFormat)) to High(TPCMFormat) do
begin
SetPCMAudioFormatS(@WaveFormatEx, pcm);
Format.Items.Append(GetWaveAudioFormat(@WaveFormat Ex));
end;
Format.ItemIndex := Ord(StockAudioRecorder.PCMFormat) - 1;
end;
procedure TMainForm.FormatChange(Sender: TObject);
begin
StockAudioRecorder.PCMFormat := TPCMFormat(Format.ItemIndex + 1);
end;
procedure TMainForm.btnRecordClick(Sender: TObject);
begin
StockAudioRecorder.RecordToFile('c:\rec.wav');
end;
procedure TMainForm.btnStopClick(Sender: TObject);
begin
if StockAudioPlayer.Active then
StockAudioPlayer.Active := False
else
StockAudioRecorder.Active := False;
end;
end.
program jest sciagniety z internetu i przerobiony jednakze nieumiem ustawic domyslnego formatu. Prosil bym o odpowiedz albo chociaz wskazowke pozdrawiam
zrodlo:
unit Main;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, WaveIn, WaveRecorders, WaveIO, WaveOut,
WavePlayers, StdCtrls, Buttons, ExtCtrls, mmSystem, WaveUtils;
type
TMainForm = class(TForm)
btnRecord: TBitBtn;
btnStop: TBitBtn;
WaveFile: TLabel;
StockAudioPlayer: TStockAudioPlayer;
StockAudioRecorder: TStockAudioRecorder;
Format: TComboBox;
procedure FormCreate(Sender: TObject);
procedure FormatChange(Sender: TObject);
procedure btnRecordClick(Sender: TObject);
procedure btnStopClick(Sender: TObject);
end;
var
MainForm: TMainForm;
implementation
{$R *.dfm}
procedure TMainForm.FormCreate(Sender: TObject);
var
pcm: TPCMFormat;
WaveFormatEx: TWaveFormatEx;
begin
for pcm := Succ(Low(TPCMFormat)) to High(TPCMFormat) do
begin
SetPCMAudioFormatS(@WaveFormatEx, pcm);
Format.Items.Append(GetWaveAudioFormat(@WaveFormat Ex));
end;
Format.ItemIndex := Ord(StockAudioRecorder.PCMFormat) - 1;
end;
procedure TMainForm.FormatChange(Sender: TObject);
begin
StockAudioRecorder.PCMFormat := TPCMFormat(Format.ItemIndex + 1);
end;
procedure TMainForm.btnRecordClick(Sender: TObject);
begin
StockAudioRecorder.RecordToFile('c:\rec.wav');
end;
procedure TMainForm.btnStopClick(Sender: TObject);
begin
if StockAudioPlayer.Active then
StockAudioPlayer.Active := False
else
StockAudioRecorder.Active := False;
end;
end.
program jest sciagniety z internetu i przerobiony jednakze nieumiem ustawic domyslnego formatu. Prosil bym o odpowiedz albo chociaz wskazowke pozdrawiam