Система обработки аудиоинформации. Подсистема фильтрации и обработки сигнала

Дипломная работа - Компьютеры, программирование

Другие дипломы по предмету Компьютеры, программирование

Скачать Бесплатно!
Для того чтобы скачать эту работу.
1. Пожалуйста введите слова с картинки:

2. И нажмите на эту кнопку.
закрыть



39;.EM1 then

begin

EM1 := TEM1File.Open(FileName);

EM1.ReadAudioData(TempAudio);

EM1.Destroy;

end;

SetnSamplesPerSec(TempAudio, AudioData.nSamplesPerSec);

SetnBitsPerSample(TempAudio, AudioData.nBitsPerSample);

SetnChannels(TempAudio, AudioData.nChannels);

end

else

begin

SetnSamplesPerSec(AudioClipBoard, AudioData.nSamplesPerSec);

SetnBitsPerSample(AudioClipBoard, AudioData.nBitsPerSample);

SetnChannels(AudioClipBoard, AudioData.nChannels);

end;

Status := editing;

SaveUndoInfo;

if Sender <> PasteFileButton then

Case PasteModeComboBox.ItemIndex of

0: InsertAudio(AudioClipBoard, AudioData, AudioPosition);

1: OverWriteAudio(AudioClipBoard, AudioData, AudioPosition);

2: MixAudio(AudioClipBoard, AudioData, AudioPosition);

end

else

Case PasteModeComboBox.ItemIndex of

0: InsertAudio(TempAudio, AudioData, AudioPosition);

1: OverWriteAudio(TempAudio, AudioData, AudioPosition);

2: MixAudio(TempAudio, AudioData, AudioPosition);

end;

DeleteMarkers;

SetAudioPosition;

SetMarker;

if Sender <> PasteFileButton then

AudioPosition := AudioPosition + AudioClipBoard.Data.Size div AudioData.nBlockAlign - 1

else

begin

AudioPosition := AudioPosition + TempAudio.Data.Size div AudioData.nBlockAlign - 1;

TempAudio.Destroy;

end;

SetAudioPosition;

SetMarker;

Status := waiting;

end;

procedure TMainForm.PasteSilenceButtonClick(Sender: TObject);

var

i: Cardinal;

b: Byte;

TempAudio: TAudioData;

begin

if (Statusstarting) then Exit;

Status := editing;

SaveUndoInfo;

TempAudio := TAudioData.Create;

TempAudio.nChannels := AudioData.nChannels;

TempAudio.nSamplesPerSec := AudioData.nSamplesPerSec;

TempAudio.nBitsPerSample := AudioData.nBitsPerSample;

TempAudio.Calculate_nBlockAlign;

b := 0;

for i := 1 to TempAudio.nSamplesPerSec*SilenceTime.Value*TempAudio.nBlockAlign do

TempAudio.Data.Write(b, 1);

InsertAudio(TempAudio, AudioData, AudioPosition);

DeleteMarkers;

SetAudioPosition;

SetMarker;

AudioPosition := AudioPosition + TempAudio.Data.Size div AudioData.nBlockAlign - 1;

SetAudioPosition;

SetMarker;

TempAudio.Destroy;

Status := waiting;

end;

procedure TMainForm.ReverseButtonClick(Sender: TObject);

var

AudioSize: Cardinal;

begin

if Status<>waiting then Exit;

Status := deformation;

SaveUndoInfo;

with AudioData do

AudioSize := Data.Size div nBlockAlign;

with Selection do

begin

if not StartExists or not FinishExists then

begin

DeleteMarkers;

Start := 0;

Finish := AudioSize-1;

end;

ReverseAudio(AudioData, Start, Finish-Start+1);

end;

Status := waiting;

end;

procedure TMainForm.NormalizeButtonClick(Sender: TObject);

var

AudioSize: Cardinal;

begin

if Status<>waiting then Exit;

Status := deformation;

with AudioData do

AudioSize := Data.Size div nBlockAlign;

with Selection do

begin

if not StartExists or not FinishExists then

begin

DeleteMarkers;

Start := 0;

Finish := AudioSize-1;

end;

Normalize(AudioData, Start, Finish-Start+1);

end;

Status := waiting;

PaintBox1.Repaint;

end;

procedure TMainForm.SetSpeedButtonClick(Sender: TObject);

var

AudioSize: Cardinal;

begin

if Status<>waiting then Exit;

Status := deformation;

with AudioData do

AudioSize := Data.Size div nBlockAlign;

with Selection do

begin

if not StartExists or not FinishExists then

begin

DeleteMarkers;

Start := 0;

Finish := AudioSize-1;

end;

SetSpeedOfAudio(AudioData, Start, Finish-Start+1, SpeedEdit.Value/100);

DeleteMarkers;

AudioPosition := Start;

SetMarker;

AudioPosition := Trunc(Start+(Finish-Start)*100/SpeedEdit.Value);

SetMarker;

AudioPosition := Start;

SetAudioPosition;

end;

Status := waiting;

end;

procedure TMainForm.ChangePropertie(Sender: TObject);

var

S: String;

Value, Code: Cardinal;

begin

if (Statusstarting) then Exit;

Status := editing;

if Sender = AudioOptionsForm.nSamplesPerSecButton then

begin

Val(AudioOptionsForm.nSamplesBox.Text, Value, Code);

SetnSamplesPerSec(AudioData, Value);

end;

if Sender = AudioOptionsForm.nBitsPerSampleButton then

begin

Val(AudioOptionsForm.nBitsBox.Text, Value, Code);

SetnBitsPerSample(AudioData, Value);

end;

if Sender = AudioOptionsForm.nChannelsButton then

begin

SetnChannels(AudioData, AudioOptionsForm.nChannelsBox.ItemIndex+1);

end;

AudioData.Calculate_nBlockAlign;

DeleteMarkers;

AudioPosition := 0;

SetAudioPosition;

Str(AudioData.nChannels, S);

AudioOptionsForm.nChannelsText.Caption := S + channels;

Str(AudioData.nBitsPerSample, S);

AudioOptionsForm.nBitsPerSampleText.Caption := S + bits;

Str(AudioData.nSamplesPerSec, S);

AudioOptionsForm.nSamplesPerSecText.Caption := S + Hz;

Status := waiting;

end;

procedure TMainForm.SetVolumeButtonClick(Sender: TObject);

var

AudioSize: Cardinal;

begin

if Status<>waiting then Exit;

Status := deformation;

with AudioData do

AudioSize := Data.Size div nBlockAlign;

with Selection do

begin

if not StartExists or not FinishExists then

begin

DeleteMarkers;

Start := 0;

Finish := AudioSize-1;

end;

SetVolumeOfAudio(AudioData, Start, Finish-Start+1, VolumeEdit.Value/100);

end;

Status := waiting;

end;

procedure TMainForm.AboutButtonClick(Sender: TObject);

begin

MessageBox(MainForm.Handle, AudioEditor v02.2006#13#13 ..#13#13, 2006#13#13smike@pochta.ru, , MB_OK);

end;

procedure TMainForm.HomePageLinkClick(Sender: TObject);

begin

ShellExecute(Handle, open, PChar(

end;

procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction);

begin

AudioData.Destroy;

AudioClipBoard.Destroy;

UndoInfo.AudioData.Destroy;

end;

procedure TMainForm.SetSpeedBitBtnClick(Sender: TObject);

var

AudioSize: Cardinal;

begin

if Status<>waiting then Exit;

Status := deformation;

SaveUndoInfo;

with AudioData do

AudioSize := Data.Size div nBlockAlign;

with Selection do

begin

if not StartExists or not FinishExists then

begin

DeleteMarkers;

Start := 0;

Finish := AudioSize-1;

end;

SetSpeedOfAudio(AudioData, Start, Finish-Start+1, SpeedEdit.Value/100);

DeleteMarkers;

AudioPosition := Start;

SetMarker;

AudioPosition := Trunc(Start+(Finish-Start)*100/SpeedEdit.Value);

SetMarker;

AudioPosition := Start;

SetAudioPosition;

end;

Status := waiting;

end;

procedure TMainForm.ChangeSpeedButtonClick(Sender: TObject);

var

AudioSize, NewCount: Cardinal;

begin

if Status<>waiting then Exit;

Status := deformation;

SaveUndoInfo;

with AudioData do

AudioSize := Data.Size div nBlockAlign;

with Selection do

begin

if not StartExists or not FinishExists then

begin

DeleteMarkers;

Start := 0;

Finish := AudioSize-1;

end;

NewCount := ChangeSpeedOfAudio(AudioData, Start, Finish-Start+1, SpeedEdit.Value/100);

DeleteMarkers;

AudioPosition := Start;

SetMarker;

AudioPosition := Start+NewCount;

SetMarker;

AudioPosition := Start;

SetAudioPosition;

end;

Status := waiting;

end;

procedure TMainForm.SetVolumeBitBtnClick(Sender: TObject);

var

AudioSize: Cardinal;

begin

if S

s