Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

conversion.h

Go to the documentation of this file.
00001 #ifndef NOATUN_CONVERT_H
00002 #define NOATUN_CONVERT_H
00003 
00004 /**
00005  * convert between sample types
00006  **/
00007 namespace Conversion
00008 {
00009 /**
00010  * Convert a mono 8 bit group to float
00011  **/
00012 void convertMono8ToFloat(unsigned long samples, unsigned char *from, float *to);
00013 /**
00014  * convert a mono 8 bit group to float, at a different speed
00015  **/
00016 void interpolateMono8ToFloat(unsigned long samples, double start, double speed,
00017                              unsigned char *from, float *to);
00018 
00019 /**
00020  * convert a mono 16 bit little-endian stream to float
00021  **/
00022 void convertMono16leToFloat(unsigned long samples, unsigned char *from, float *to);
00023 
00024 /**
00025  * convert a mono 16 bit little-endian stream to float at a different speed
00026  **/
00027 void interpolateMono16leToFloat(unsigned long samples, double startpos, double speed,
00028                                 unsigned char *from, float *to);
00029 
00030 /**
00031  * convert an stereo 8-bit interleaved (Alternating left/right channel) to floats
00032  **/
00033 void convertStereoI8To2Float(unsigned long samples, unsigned char *from,
00034                              float *left, float *right);
00035 
00036 /**
00037  * convert a stereo 8-bit interleaved (alternating left/right channel) to floats, 
00038  * at a different speed
00039  **/
00040 void interpolateStereoI8To2Float(unsigned long samples, double startpos, double speed,
00041                                  unsigned char *from, float *left, float *right);
00042 /**
00043  * convert an interleaved 16 bit little endian stream to two floats
00044  **/
00045 void convertStereoI16leTo2Float(unsigned long samples, unsigned char *from, float *left,
00046                                 float *right);
00047 
00048 /**
00049  * convert an interleaved 16 bit little endian stream to two floats at a different
00050  * speed
00051  **/
00052 void interpolateStereoI16leTo2Float(unsigned long samples, double startpos, double speed,
00053                                     unsigned char *from, float *left, float *right);
00054 
00055 /**
00056  * convert a float to a float, but at a different speed
00057  **/
00058 void interpolateMonoFloatToFloat(unsigned long samples, double startpos, double speed,
00059                                  float *from, float *to);
00060 
00061 /**
00062  * convert a stereo interleaved float to two floats
00063  **/
00064 void convertStereoIFloatTo2Float(unsigned long samples, float *from, float *left,
00065                                  float *right);
00066 
00067 /**
00068  * convert a stereo interleaved float to two floats at a different speed
00069  **/
00070 void interpolateStereoIFloatTo2Float(unsigned long samples, double startpos,
00071                                      double speed, float *from, float *left,
00072                                      float *right);
00073 
00074 /**
00075  * convert a mono float to a 16 bit little endian float
00076  **/
00077 void convertMonoFloatTo16le(unsigned long samples, float *from, unsigned char *to);
00078 
00079 /**
00080  * convert a two floats to a 16 bit little endian interleaved float
00081  **/
00082 void convertStereo2FloatToI16le(unsigned long samples, float *left, float *right,
00083                                 unsigned char *to);
00084 
00085 /**
00086  * convert a mono float to an 8 bit stream
00087  **/
00088 void convertMonoFloatTo8(unsigned long samples, float *from, unsigned char *to);
00089 
00090 /**
00091  * convert two floats to an 8 bit interleaved stream
00092  **/
00093 void convertStereo2FloatToI8(unsigned long samples, float *left, float *right,
00094                              unsigned char *to);
00095 
00096 /**
00097  * to little endian (Intel) with swapEndian
00098  * does nothing if this is an intel
00099  **/
00100 inline void toLittleEndian(unsigned long len, char *buffer);
00101 
00102 /**
00103  * to big endian with swapEndian
00104  * does nothing if this isn't an intel
00105  **/
00106 inline void toBigEndian(unsigned long len, char *buffer);
00107 
00108 /**
00109  * swap the endian, does so on every platform
00110  * operates on 16 bits at a time. so loads 16, swaps, and copies them
00111  **/
00112 void swapEndian(unsigned long length, char *buffer);
00113 
00114 
00115 }
00116 
00117 
00118 #endif
00119 

Generated at Mon Apr 1 11:45:00 2002 for noatun by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001