Update contrib.
1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // include\mmf\utils\rateconvert.h
29 Base utility class to change the sample rate of audio data in a buffer
31 class CChannelAndSampleRateConverter : public CBase
34 CChannelAndSampleRateConverter();
38 Create a converter that will do rate and channel conversion as requested
40 IMPORT_C static CChannelAndSampleRateConverter* CreateL(TInt aFromRate,TInt aFromChannels,
41 TInt aToRate,TInt aToChannels);
43 Reads the audio data from the source buffer,
44 converts the number of channels and the sample rate
45 and copies the result to the destination buffer
48 The source buffer containing the audio data to convert.
50 The destination buffer - assumed big enough
52 @return The length of the source buffer that was consumed.
54 virtual TInt Convert(const TDesC8& aSrcBuffer, TDes8& aDstBuffer)=0;
55 virtual void Reset()=0;
58 Indicates what buffer size is required to hold the converted data.
59 Support size of original buffer.
60 aRoundUpToPower means give next power of 2 size up from raw size.
61 NB. May be bigger than strictly necessary.
63 virtual TInt MaxConvertBufferSize(TInt aSrcBufferSize, TBool aRoundUpToPower=EFalse)=0;