1
0

minimp3.h 559 B

12345678910111213141516171819
  1. #ifndef __MINIMP3_H_INCLUDED__
  2. #define __MINIMP3_H_INCLUDED__
  3. #define MP3_MAX_SAMPLES_PER_FRAME (1152*2)
  4. typedef struct _mp3_info {
  5. int sample_rate;
  6. int channels;
  7. int audio_bytes; // generated amount of audio per frame
  8. } mp3_info_t;
  9. typedef void* mp3_decoder_t;
  10. extern mp3_decoder_t mp3_create(void);
  11. extern int mp3_decode(mp3_decoder_t *dec, void *buf, int bytes, signed short *out, mp3_info_t *info);
  12. extern void mp3_done(mp3_decoder_t *dec);
  13. #define mp3_free(dec) do { mp3_done(dec); dec = NULL; } while(0)
  14. #endif//__MINIMP3_H_INCLUDED__