1 // lame encoding functions for butt 2 // 3 // Copyright 2007-2018 by Daniel Noethen. 4 // 5 // This program is free software; you can redistribute it and/or modify 6 // it under the terms of the GNU General Public License as published by 7 // the Free Software Foundation; either version 2, or (at your option) 8 // any later version. 9 // 10 // This program is distributed in the hope that it will be useful, 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 // GNU General Public License for more details. 14 // 15 16 #ifndef LAME_ENCODE_H 17 #define LAME_ENCODE_H 18 19 #include <stdlib.h> 20 #include <lame/lame.h> 21 22 23 struct lame_enc { 24 lame_global_flags *gfp; 25 int bitrate; 26 int samplerate; 27 int channel; 28 volatile int state; 29 }; 30 31 enum { 32 LAME_READY = 0, 33 LAME_BUSY = 1 34 }; 35 36 int lame_enc_init(lame_enc *lame); 37 int lame_enc_encode(lame_enc *lame, short *pcm_buf, char *enc_buf, int samples, int size); 38 int lame_enc_reinit(lame_enc *lame); 39 void lame_enc_close(lame_enc *lame); 40 41 #endif 42 43