public void setAudioEncoding ( final int audioEncoding ) { if ( audioEncoding != AudioFormat . ENCODING_PCM_8BIT && audioEncoding != AudioFormat . ENCODING_PCM_16BIT ) { throw new IllegalArgumentException ( "Invalid encoding" ) ; } else if ( currentAudioState . get ( ) != PREPARED_STATE && currentAudioState . get ( ) != INITIALIZED_STATE ) { throw new IllegalStateException ( "Cannot modify audio encoding during a non-prepared and non-initialized state" ) ; } this . audioEncoding = audioEncoding ; }
Sets the encoding for the audio file .