Included is a quick patch to allow you to encode from 8bit files (wav/8svx etc)
when using libsndfile...
Oh, btw, how about automatic resampling when the input samplerate doesn't match
any of the allowed mpeg samplerates? ;)
*** get_audio.c Tue Nov 16 21:43:30 1999
--- get_audio.c.new Sun Nov 21 23:05:49 1999
***************
*** 12,17 ****
--- 12,18 ----
static int samp_freq;
static int input_bitrate;
static int num_channels;
+ static int bitwidth;
int read_samples_pcm( short sample_buffer[2304],int frame_size, int samples_to_read);
int read_samples_mp3(FILE *musicin,short int mpg123pcm[2][1152],int num_chan);
***************
*** 374,379 ****
--- 375,381 ----
printf("sections :%d\n",gs_wfInfo.sections);
printf("seekable :\n",gs_wfInfo.seekable);
#endif
+ bitwidth=gs_wfInfo.pcmbitwidth;
}
}
***************
*** 404,409 ****
--- 406,414 ----
if (samples_read<0) samples_read=0;
for (; samples_read < frame_size; sample_buffer[samples_read++] = 0);
}
+
+ if (bitwidth==8) for (; samples_read > 0; sample_buffer[samples_read] =
+sample_buffer[samples_read--] * 256);
+
return(rcode);
}
- CISC
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )