public byte [ ] process ( byte [ ] media ) { frame ++ ; float [ ] new_speech = new float [ media . length ] ; short [ ] shortMedia = Util . byteArrayToShortArray ( media ) ; for ( int i = 0 ; i < LD8KConstants . L_FRAME ; i ++ ) { new_speech [ i ] = ( float ) shortMedia [ i ] ; } preProc . pre_process ( new_speech , LD8KConstants . L_FRAME ) ; encoder . loadSpeech ( new_speech ) ; encoder . coder_ld8k ( prm , 0 ) ; //byte[] a = new byte[10]; Bits . prm2bits_ld8k ( prm , serial ) ; // return a; return Bits . toRealBits ( serial ) ; }
Perform compression .