A confession of the defendant shall not be sufficient to warrant conviction without evidence that the offense charged has been committed; nor can it be given in evidence against the defendant whether made in the course of judicial proceedings or to a private person, when made under the influence of fear produced by threats.