X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswfsound.c;h=d76baec513275bd69f53906d29e331ed0f85f3f2;hb=879d0eec420fe0fd5ddcd56c8fe62b82a6744edd;hp=8edec3509f3c8c3dc2b3930afea7b65d7dd124e8;hpb=e3147ae362f22e9627c7eace0b33d01c09e30f25;p=swftools.git diff --git a/lib/modules/swfsound.c b/lib/modules/swfsound.c index 8edec35..d76baec 100644 --- a/lib/modules/swfsound.c +++ b/lib/modules/swfsound.c @@ -77,6 +77,13 @@ void swf_SetSoundStreamBlock(TAG*tag, S16*samples, int numsamples, char first) } #endif +void swf_SetSoundDefineRaw(TAG*tag, S16*samples, int numsamples) +{ + swf_SetU8(tag,(/*compression*/0<<4)|(/*rate*/3<<2)|(/*size*/1<<1)|/*mono*/0); + swf_SetU32(tag, numsamples); // 44100 -> 11025 + swf_SetBlock(tag, (U8*)samples, numsamples*2); +} + /* TODO: find a better way to set these from the outside */ int swf_mp3_in_samplerate = 44100; @@ -192,12 +199,6 @@ void swf_SetSoundStreamEnd(TAG*tag) lame_close (lame_flags); } -void swf_SetSoundDefineRaw(TAG*tag, S16*samples, int num, int samplerate) -{ - //swf_SetU8(tag,(/*compression*/0<<4)|(/*rate*/3<<2)|(/*size*/1<<1)|/*mono*/0); - //swf_SetU32(tag, numsamples); // 44100 -> 11025 - //swf_SetBlock(tag, wav2.data, numsamples*2); -} void swf_SetSoundDefine(TAG*tag, S16*samples, int num) { char*buf; @@ -256,23 +257,19 @@ void swf_SetSoundDefine(TAG*tag, S16*samples, int num) void swf_SetSoundStreamHead(TAG*tag, int avgnumsamples) { - fprintf(stderr, "Error: no sound support compiled in.\n");exit(1); + fprintf(stderr, "Error: no mp3 soundstream support compiled in.\n");exit(1); } void swf_SetSoundStreamBlock(TAG*tag, S16*samples, int seek, char first) { - fprintf(stderr, "Error: no sound support compiled in.\n");exit(1); + fprintf(stderr, "Error: no mp3 soundstream support compiled in.\n");exit(1); } void swf_SetSoundStreamEnd(TAG*tag) { - fprintf(stderr, "Error: no sound support compiled in.\n");exit(1); -} -void swf_SetSoundDefineRaw(TAG*tag, S16*samples, int num, int samplerate) -{ - fprintf(stderr, "Error: no sound support compiled in.\n");exit(1); + fprintf(stderr, "Error: no mp3 soundstream support compiled in.\n");exit(1); } void swf_SetSoundDefine(TAG*tag, S16*samples, int num) { - fprintf(stderr, "Error: no sound support compiled in.\n");exit(1); + swf_SetSoundDefineRaw(tag, samples,num); } #endif