![]() InputStream is = new FileInputStream(pcm) īufferedInputStream bis = new BufferedInputStream(is) RECORDER_AUDIO_ENCODING, BufferElements2Rec * BytesPerElement) Īnd this is my code that uses liblame for encode mp3 and write it to file: //Encoder.Builder(int inSamplerate,int outChannel,int outSampleRate,int outBitrate)Įncoder en = new Encoder.Builder(8000, 1,8000,128).quality(7).create() įile pcm = new File("/sdcard/voice8K16bitmono.pcm") įile mp3 = new File("/sdcard/BOOOB.mp3") Int BytesPerElement = 2 // 2 bytes in 16bit format Int BufferElements2Rec = 1024 // want to play 2048 (2K) since 2 bytes we use only 1024 Private static final int RECORDER_AUDIO_ENCODING = AudioFormat.ENCODING_PCM_16BIT Private static final int RECORDER_CHANNELS = AudioFormat.CHANNEL_IN_MONO These are recorded audio specifications(pcm file): private static final int RECORDER_SAMPLERATE = 8000 the result mp3 file but is not correct and it has a lot of noise on it and really hard to understand that it was recorded pcm file. I read the pcm file and encoded it into mp3 and then I write it in the file. I am using SimpleLameLibForAndroid to convert a pcm file that created using AudioRecord class in android,to mp3.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |