00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #pragma once
00023
00024 #include <windows.h>
00025 #include <MMREG.H>
00026 #include <mmsystem.h>
00027 #include <msacm.h>
00028
00029 typedef long (*AudioPointSampler)(void *, void *, long, long, long);
00030 typedef long (*AudioDownSampler)(void *, void *, long *, int, long, long, long);
00031
00032 class AudioStreamResampler
00033 {
00034 private:
00035 AudioPointSampler ptsampleRout;
00036 AudioDownSampler dnsampleRout;
00037 long samp_frac;
00038 long accum;
00039 int holdover;
00040 long *filter_bank;
00041 int filter_width;
00042 bool fHighQuality;
00043
00044 enum { BUFFER_SIZE=512 };
00045 BYTE cbuffer[4*BUFFER_SIZE];
00046 int bps;
00047
00048 public:
00049 AudioStreamResampler(int bps, long org_rate, long new_rate, bool fHighQuality);
00050 ~AudioStreamResampler();
00051
00052 long Downsample(void* input, long samplesin, void* output, long samplesout);
00053 };
00054