code: public boolean setStreamConfiguration(StreamConfiguration sc) {
      boolean changed = false;
      sc = new StreamConfiguration(sc);
      if(sc != null) {
        if(flacStreamIsOpen || isEncoding)
          changed = false;
        else {
          streamLock.lock();
          try{
            if(flacStreamIsOpen || isEncoding) {//can't change streamconfig on open stream.
            changed = false;
            }
            else {
              streamConfig = sc;
              reset();
              frame = new Frame(sc);
              prepareThreadManager(sc);
              this.setEncodingConfiguration(this.encodingConfig);
              clear();
              changed = true;
            }
          }finally {
          streamLock.unlock();
          }
        }
      }
      return changed;
    }
docs: Set the stream configuration to that specified. The given stream
  configuration is not stored by this object, but instead copied. This
  is to prevent the alteration of the config during an encode process.
  This method must not be called in the middle of a stream, stream contents
  may become invalid. Calling this method clears any data stored by this
  encoder. A call to setStreamConfiguration() should be followed next by
  setting the output stream if not yet done, and then calling
  openFLACStream();
  
  @param sc StreamConfiguration to use.
  @return true if the configuration was altered; false if the configuration
  cannot be altered(such as if another thread is currently encoding).