From: kramm Date: Sat, 22 Feb 2003 20:21:56 +0000 (+0000) Subject: allow to set samplerate/channels from outside. X-Git-Tag: release-0-4-4~83 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=f14390c59ccf526e32cf4e3c12fb0cefe6bff8ab allow to set samplerate/channels from outside. --- diff --git a/lib/modules/swfsound.c b/lib/modules/swfsound.c index d0bfc20..2209d85 100644 --- a/lib/modules/swfsound.c +++ b/lib/modules/swfsound.c @@ -70,15 +70,19 @@ void swf_SetSoundStreamBlock(TAG*tag, S16*samples, int numsamples, char first) #ifdef LAME #include "../lame/lame.h" - + +/* TODO: find a way to set these from the outside */ +int swf_mp3_samplerate = 44100; +int swf_mp3_channels = 1; + static lame_global_flags*lame_flags; static void initlame(unsigned char*buf, int bufsize) { lame_flags = lame_init(); - lame_set_in_samplerate(lame_flags, 44100); - lame_set_num_channels(lame_flags, 1); + lame_set_in_samplerate(lame_flags, swf_mp3_samplerate); + lame_set_num_channels(lame_flags, swf_mp3_channels); lame_set_scale(lame_flags, 0); // MPEG1 32, 44.1, 48khz