The application that I am trying to develop for andriod, records frames at 48Khz (PCM 16bits & mono) and sends them to the network. Also, there is an incoming stream of
A quick and dirty solution would be linear interpolation. Since you're always sampling up by a factor of six this is really easy to do:
It works somewhat like this (C-code, and untested, and I don't handle the last iteration properly, but it shows the idea I think).
void resample (short * output, short * input, int n)
{
// output ought to be 6 times as large as input (48000/8000).
int i;
for (i=0; i
Linear interpolation won't give you great sound quality but it is cheap and fast. You can improve this using cubic interpolation if you want to.
If you want a fast and high quality resampling I suggest that you compile a c resampling library like libresample using the Android-NDK and call it from java using JNI. That will be a lot faster. Writing the JNI code is something most people shy away from, but it's quite easy.. The NDK has lots of examples for this.
http://www.mega-nerd.com/SRC/index.html