| View previous topic :: View next topic |
| Author |
Message |
jeanrl Member
Joined: 28 Aug 2004 Posts: 8
|
Posted: 28/08/04 18:55 Post subject: How change BitRate in StockAudioRecorder |
|
|
I like change the BitRate in StockAudioRecorder because it's record very hight (1411 kbps) and I like 128 kpbs.
How change?
Thank's and escuse for my inglish. |
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 414 Location: Tehran, Iran
|
Posted: 29/08/04 08:40 Post subject: |
|
|
You should change the audio format.
The bit rate of "PCM 8.000 kHz, 16 Bit, Mono" is 128 kbps. |
|
| Back to top |
|
 |
jeanrl Member
Joined: 28 Aug 2004 Posts: 8
|
Posted: 29/08/04 19:22 Post subject: |
|
|
It's possible "PCM 44.100 kHz, 16 Bit, Stereo" with 128 kbps?
If yes please show me how I do.
Thansk's very mouch. |
|
| Back to top |
|
 |
Johnny_Bit Moderator
Joined: 15 Jun 2003 Posts: 158
|
Posted: 31/08/04 06:50 Post subject: |
|
|
| PCM is not compressed! thos kbps is data size for one second. I Think you want to get MP3? Am I right? If yes then simply record PCM, and then using Some compressor (ex. LAME) to compress it. |
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 414 Location: Tehran, Iran
|
Posted: 31/08/04 08:41 Post subject: |
|
|
| jeanrl wrote: | | It's possible "PCM 44.100 kHz, 16 Bit, Stereo" with 128 kbps? |
No, it's not possible.
| Code: | Samples Per Second * Bits Per Sample * Number of Channels = Bit Rate
44.100 * 16 * 2 = 1411.2 kbps |
|
|
| Back to top |
|
 |
jeanrl Member
Joined: 28 Aug 2004 Posts: 8
|
Posted: 31/08/04 11:39 Post subject: |
|
|
Hi Johnny_Bit and Kambiz.
Jhonny it is accurately this that I am making, however the record this being very big because of bitreats them high, understend?
Ok, thank's to all for the attention.
Jean
jeanrl@netsite.com.br |
|
| Back to top |
|
 |
Johnny_Bit Moderator
Joined: 15 Jun 2003 Posts: 158
|
Posted: 31/08/04 13:20 Post subject: |
|
|
| Do you want on-the-fly compression? |
|
| Back to top |
|
 |
jeanrl Member
Joined: 28 Aug 2004 Posts: 8
|
Posted: 01/09/04 13:10 Post subject: |
|
|
| If possible, yes! |
|
| Back to top |
|
 |
Johnny_Bit Moderator
Joined: 15 Jun 2003 Posts: 158
|
Posted: 01/09/04 17:17 Post subject: |
|
|
| As far as I remember you simply chose other format than PCM, in my windows it's a preety big list of format, and most interesting for you as I assume is Frauhoffer Institute MP3... If you don't have it you should check mp3dev.org for LAME codec |
|
| Back to top |
|
 |
jeanrl Member
Joined: 28 Aug 2004 Posts: 8
|
Posted: 01/09/04 17:29 Post subject: |
|
|
| Ok, but as I choose another format? |
|
| Back to top |
|
 |
Johnny_Bit Moderator
Joined: 15 Jun 2003 Posts: 158
|
Posted: 05/09/04 06:56 Post subject: |
|
|
| Currently I cannot help you, because my system has big problems that i cannot solve, wich includes problems with encoders, but you can check Virtual Dub source code, they got some good wor on it. |
|
| Back to top |
|
 |
jeanrl Member
Joined: 28 Aug 2004 Posts: 8
|
Posted: 05/09/04 21:32 Post subject: |
|
|
Ok, very thank's for your attention, but only more a question, can say me where finds the "Virtual Dub source code"?
Very thansk's. |
|
| Back to top |
|
 |
Johnny_Bit Moderator
Joined: 15 Jun 2003 Posts: 158
|
|
| Back to top |
|
 |
jeanrl Member
Joined: 28 Aug 2004 Posts: 8
|
Posted: 06/09/04 13:50 Post subject: |
|
|
| Ok, thank's a lot. |
|
| Back to top |
|
 |
jeanrl Member
Joined: 28 Aug 2004 Posts: 8
|
Posted: 07/09/04 13:28 Post subject: |
|
|
I obtain with these installed functions to call codec however my question is as to pass codec chosen to StockAudioRecorder using the chosen compression?
Functions:
function TForm1.AllocWaveFormatEx : Integer;
begin
FWaveFormat.cbSize
if acmMetrics(nil, ACM_METRIC_MAX_SIZE_FORMAT, FMaxFmtSize) <> 0 then begin
showmessage('Error getting the max compression format size.');
Result := -1;
Exit;
end;
GetMem(FWaveFormat, FMaxFmtSize);
if FWaveFormat = nil then begin
showmessage('Error allocating local memory for WaveFormatEx structure.');
Result := -2;
Exit;
end;
// initialize the format to standard PCM...
FillChar(FWaveFormat^, FMaxFmtSize, 0);
FWaveFormat.wFormatTag := WAVE_FORMAT_PCM;
FWaveFormat.nChannels := 1;
FWaveFormat.nSamplesPerSec := 11025;
FWaveFormat.nAvgBytesPerSec := 11025;
FWaveFormat.nBlockAlign := 1;
FWaveFormat.wBitsPerSample := 8;
FWaveFormat.cbSize := 0;
// store the format and tag decription strings...
GetFormatTagDetails(FWaveFormat.wFormatTag);
GetFormatDetails(FWaveFormat);
Result := 0;
end;
function TForm1.GetWaveFormat : integer;
var
acmopt : TACMFORMATCHOOSE;
err : MMRESULT;
ptmpfmt : PWAVEFORMATEX;
begin
GetMem(ptmpfmt, FMaxFmtSize);
if ptmpfmt = nil then begin
showmessage('Error allocating temporary format buffer.');
Result := -1;
Exit;
end;
Move(FWaveFormat^, ptmpfmt^, FMaxFmtSize);
// setup ACM choose fields and display the dialog...
FillChar(acmopt, sizeof(acmopt), 0); // zero out
acmopt.cbStruct := sizeof(acmopt);
acmopt.fdwStyle := ACMFORMATCHOOSE_STYLEF_INITTOWFXSTRUCT;
acmopt.hwndOwner := Handle;
acmopt.pwfx := FWaveFormat;
acmopt.cbwfx := FMaxFmtSize;
acmopt.pszTitle := 'Select Compression';
acmopt.fdwEnum := ACM_FORMATENUMF_INPUT;
err := acmFormatChoose(acmopt);
// if the same format was selected we don't want to reset FTotalWaveSize
// below, so act like a cancel...
if CompareMem(FWaveFormat, ptmpfmt, sizeof(TWAVEFORMATEX)) then
err := ACMERR_CANCELED;
if err <> MMSYSERR_NOERROR then begin
Move(ptmpfmt^, FWaveFormat^, FMaxFmtSize);
FreeMem(ptmpfmt);
if err = ACMERR_CANCELED then begin
Result := 0;
Exit;
end;
showmessage('Error in FormatChoose function');
Result := -2;
Exit;
end;
// store the format description...
FFormatDesc := acmopt.szFormat;
// get the format tag details, we don't need to call acmGetFormatDetails since
// that information was supplied by the choose function...
GetFormatTagDetails(acmopt.pwfx.wFormatTag);
FreeMem(ptmpfmt);
// now set the play button to a grayed state cause we don't want
// to try to play the recorded data with a different format...
FTotalWaveSize := 0;
Result := 0;
end;
function TForm1.GetFormatDetails(pfmtin : PWAVEFORMATEX) : integer;
var
acmfmtdetails : TACMFORMATDETAILS;
begin
// zero out struct...
FillChar(acmfmtdetails, sizeof(acmfmtdetails), 0);
acmfmtdetails.cbStruct := sizeof(acmfmtdetails);
acmfmtdetails.pwfx := pfmtin;
acmfmtdetails.dwFormatTag := pfmtin.wFormatTag;
acmfmtdetails.cbwfx := sizeof(TWAVEFORMATEX) + pfmtin.cbSize;
if acmFormatDetails(nil, acmfmtdetails,
ACM_FORMATDETAILSF_FORMAT) <> 0 then begin
showmessage('Warning, FormatDetails function failed');
Result := -1;
Exit;
end;
// store the format details description string...
FFormatDesc := acmfmtdetails.szFormat;
Result := 0;
end;
I tried using onFormat but I did not obtain, then I ask: It has as to pass codec chosen for the StockAudioRecorder?
Thank's and sorry for insistence.
Jean
jeanrl@netsite.com.br |
|
| Back to top |
|
 |
|