home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / flash078.zip / flashsource-r0_7_8.zip / FlashMP3Encoder.h < prev    next >
C/C++ Source or Header  |  2001-08-02  |  1KB  |  47 lines

  1. /* MP3 Encoding Extension Class
  2.    Author: Jesse Ezell <JesseEzell@netscape.net>
  3.    Last Updated: Oct. 12, 2000
  4. */
  5.  
  6. #ifndef H_FLASHMP3_JE
  7. #define H_FLASHMP3_JE
  8.  
  9. #include "FBase.h"
  10. #include <stdio.h>
  11. #include <vector>
  12.  
  13. class FlashMP3Encoder
  14. {
  15. public:
  16.     FlashMP3Encoder(const char *filename, int FrameRate);
  17.     ~FlashMP3Encoder();
  18.  
  19.     UWORD WriteDefineTag(std::ostream &out);
  20.     
  21.     void WriteHeader(std::ostream &out);
  22.     void WriteStream(std::ostream &out);
  23.  
  24. private:
  25.     int GetMp3FrameSize (char *szMp3File, long *pnFrameSize, long *pnPCMFrameSize);    
  26.     int ReadMp3Frame (FILE *fp, char *lpData, long *pnSize);
  27.     int SeekToNextValidHeader (FILE *fp, int &layer, int &ver, int &freq, int &stereo, int &rate);
  28.  
  29.     std::vector<char *> m_frameData;    
  30.     std::vector<UDWORD>    m_sizes;
  31.     
  32.         long m_delay;
  33.         int m_frameRate;
  34.         unsigned long m_pos;
  35.         bool m_done;
  36.         long m_frame;
  37.  
  38.     int m_layer;
  39.     int m_ver;
  40.     int m_freq;
  41.     int m_stereo;
  42.     int m_rate;
  43.     long pcmFrameSize;
  44. };
  45.  
  46. #endif
  47.