- Main Page
- Namespaces
- Classes
- Files
- Directories

- File List
- File Members

# Audio.h

    00001 /*
    00002  *      Copyright (C) 2003-2005 Gabest
    00003  *      http://www.gabest.org
    00004  *
    00005  *  This Program is free software; you can redistribute it and/or modify
    00006  *  it under the terms of the GNU General Public License as published by
    00007  *  the Free Software Foundation; either version 2, or (at your option)
    00008  *  any later version.
    00009  *
    00010  *  This Program is distributed in the hope that it will be useful,
    00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    00013  *  GNU General Public License for more details.
    00014  *
    00015  *  You should have received a copy of the GNU General Public License
    00016  *  along with GNU Make; see the file COPYING.  If not, write to
    00017  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
    00018  *  http://www.gnu.org/copyleft/gpl.html
    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