From f14390c59ccf526e32cf4e3c12fb0cefe6bff8ab Mon Sep 17 00:00:00 2001 From: kramm Date: Sat, 22 Feb 2003 20:21:56 +0000 Subject: [PATCH] allow to set samplerate/channels from outside. --- lib/modules/swfsound.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 -- 1.7.10.4