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;
    }
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.
@param audioEncoding Must be {@link AudioFormat}.ENCODING_PCM_8BIT or {@link AudioFormat}.ENCODING_PCM_16BIT.
@throws IllegalArgumentException If the encoding is not {@link AudioFormat}.ENCODING_PCM_8BIT or {@link AudioFormat}.ENCODING_PCM_16BIT
@throws IllegalStateException If it is being modified when it is not in INITIALIZED_STATE or PREPARED_STATE.