Article View: borland.public.cppbuilder.multimedia
Article #1082Re: How to use Audio Compression Manager
From: Omar Zelaya
Date: Thu, 04 Oct 2001 05:53
Date: Thu, 04 Oct 2001 05:53
66 lines
3418 bytes
3418 bytes
Here is a small example(not the best code out there but it should work)
void __fastcall ConvertWav(TMemoryStream *InStream,
ACMWaveFormat* InFormat,
TMemoryStream *OutStream,
ACMWaveFormat* OutFormat,
HWND AHandle)
{ MMRESULT Result;
HACMSTREAM StreamHandle;
DWORD OutputBufferSize,
InputBufferSize;
AnsiString Mensaje;
ACMSTREAMHEADER StreamHeader;
bool OkConvert = false;
if (acmStreamOpen(&StreamHandle,
NULL,&InFormat->Format,
&OutFormat->Format,
NULL, 0, 0, ACM_STREAMOPENF_NONREALTIME) == 0)
{ InputBufferSize = InStream->Size;
if (acmStreamSize(StreamHandle,
InputBufferSize,
&OutputBufferSize,
ACM_STREAMSIZEF_SOURCE) == 0)
{ OutStream->SetSize(OutputBufferSize);
StreamHeader.cbStruct = sizeof(ACMSTREAMHEADER);
StreamHeader.fdwStatus = 0;
StreamHeader.dwUser = 0;
StreamHeader.pbSrc = (BYTE*) InStream->Memory;
StreamHeader.cbSrcLength = InputBufferSize;
StreamHeader.cbSrcLengthUsed = 0;
StreamHeader.dwSrcUser = 0;
StreamHeader.pbDst = (BYTE*) OutStream->Memory;
StreamHeader.cbDstLength = OutputBufferSize;
StreamHeader.cbDstLengthUsed = 0;
StreamHeader.dwDstUser = 0;
if (acmStreamPrepareHeader(StreamHandle,
&StreamHeader, 0) == 0)
{ if (acmStreamConvert(StreamHandle,
&StreamHeader,
ACM_STREAMCONVERTF_BLOCKALIGN) == 0)
OkConvert = true;
else OkConvert = false;
acmStreamReset(StreamHandle,0);
acmStreamUnprepareHeader(StreamHandle, &StreamHeader, 0);
}
}
acmStreamClose(StreamHandle, 0);
}
if (OkConvert)
OutStream->Position = 0;
else OutStream->Clear();
return;
}
"Kit" <s4110020@maliwan.psu.ac.th> wrote in message news:3b9cb560_1@dnews...
>
> please suggest me and describe about How to use Audio Compression
> manager or example code
>
> Thank you
>
>
>
>
Technical Details
Message-ID:
<3bbbf95d_2@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3b9cb560_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d0fc,9a63df3f770efd67 X-Google-Attributes: gid10d0fc,public X-Google-ArrivalTime: 2001-10-03 23:08:37 PST Reply-To: "Omar Zelaya" <ozelaya@invdochat.com> From: "Omar Zelaya" <ozelaya@invdochat.com> Newsgroups: borland.public.cppbuilder.multimedia References: <3b9cb560_1@dnews> Subject: Re: How to use Audio Compression Manager Date: Wed, 3 Oct 2001 23:53:00 -0600 Lines: 68 Organization: InSoftware X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 NNTP-Posting-Host: 200.62.43.227 Message-ID: <3bbbf95d_2@dnews> X-Trace: dnews 1002174813 200.62.43.227 (3 Oct 2001 22:53:33 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews