AudioRecorder and MP3. Is it possible?

Please post bug reports, feature requests, or any question regarding the DELPHI AREA products here.

AudioRecorder and MP3. Is it possible?

Postby Ray Adams » November 4th, 2004, 11:36 am

Hi.
At first, thanks for the great audio package! Its very usefull!
And now some questions.
1st.
I try to record directly to MP3 format. I've installed mp3 encoder , and trying to use OnFormat event. Also I found record for MP3 format
Code: Select all
  mpeglayer3waveformat_tag=packed record
  wfx:TWAVEFORMATEX;
  wID:word;
  fdwFlags:dword;
  nBlockSize:word;
  nFramesPerBlock:word;
  nCodecDelay:word;
  end;

and here is a code
Code: Select all
procedure TMainForm.StockAudioRecorderFormat(Sender: TObject;
  out pWaveFormat: PWaveFormatEx; var FreeIt: Boolean);
begin
     FreeIt:=false;
     pWaveFormat:=@mp3;
     mp3.wfx.nChannels:=2;
     mp3.wfx.nSamplesPerSec:=44100;
     mp3.wfx.nAvgBytesPerSec:=44100;
     mp3.wfx.wBitsPerSample:=8;
     mp3.wfx.cbSize:=sizeof(mp3.wfx);
     mp3.wfx.nBlockAlign:=2;

     //#WAVE_FORMAT_MPEGLAYER3                 0x0055 /* ISO/MPEG Layer3 Format Tag */
     mp3.wfx.wFormatTag:=$55;

     mp3.nFramesPerBlock:=8;// ???
     mp3.nCodecDelay:=0;// ???
     //MPEGLAYER3_FLAG_PADDING_ISO      0x00000000
     mp3.fdwFlags:=0;
     // MPEGLAYER3_ID_MPEG               1
     mp3.wID:=1;
end;

I don't know is it a right way to force use MP3 encoder or not. It doesnt work :(
Any one know how to do it?
Ray Adams
Member
Member
 
Posts: 1
Joined: November 4th, 2004, 11:29 am

Return to DELPHI AREA Products

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

cron