X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswfsound.c;fp=lib%2Fmodules%2Fswfsound.c;h=ac60b5531376ffed47581a9dd37824a6f892dd78;hb=43c3ac72afff7572fbf71820ab7a982cd607a83d;hp=b2801bdbd6bd79116d8ae909601cc93c4f6d9152;hpb=816a39e5b64575a15a0579c20208352b74bc1bd1;p=swftools.git diff --git a/lib/modules/swfsound.c b/lib/modules/swfsound.c index b2801bd..ac60b55 100644 --- a/lib/modules/swfsound.c +++ b/lib/modules/swfsound.c @@ -74,6 +74,7 @@ void swf_SetSoundStreamBlock(TAG*tag, S16*samples, int numsamples, char first) /* TODO: find a way to set these from the outside */ int swf_mp3_samplerate = 44100; int swf_mp3_channels = 1; +int swf_mp3_bitrate = 32; static lame_global_flags*lame_flags; @@ -93,6 +94,7 @@ static void initlame(unsigned char*buf, int bufsize) lame_set_quality(lame_flags, 0); lame_set_mode(lame_flags, MONO/*3*/); + lame_set_brate(lame_flags, swf_mp3_bitrate); //lame_set_compression_ratio(lame_flags, 11.025); lame_set_bWriteVbrTag(lame_flags, 0); @@ -187,7 +189,8 @@ void swf_SetSoundDefine(TAG*tag, S16*samples, int num) blocks = num / (blocksize); swf_SetU8(tag,(compression<<4)|(rate<<2)|(size<<1)|type); - swf_SetU32(tag,blocks*blocksize); + + swf_SetU32(tag,blocks*blocksize / 4); // 44100 -> 11025 buf = malloc(bufsize); if(!buf) @@ -219,7 +222,7 @@ void swf_SetSoundDefine(TAG*tag, S16*samples, int num) void swf_SetSoundInfo(TAG*tag, SOUNDINFO*info) { U8 flags = (info->stop?SOUNDINFO_STOP:0) - |(info->multiple?SOUNDINFO_NOMULTIPLE:0) + |(info->nomultiple?SOUNDINFO_NOMULTIPLE:0) |(info->envelopes?SOUNDINFO_HASENVELOPE:0) |(info->loops?SOUNDINFO_HASLOOPS:0) |(info->outpoint?SOUNDINFO_HASOUTPOINT:0)