In all cases where the fees prescribed by this act in criminal cases for the sheriff, clerk and witnesses for the state, are not paid by the defendant or the prosecuting witness, they shall be paid by the county in which the criminal prosecution is instituted: Provided, That no such fees shall be paid by the board of county commissioners until the sheriff shall have filed his affidavit that said fees cannot be collected from any other source. Jury fees in civil and criminal cases shall be paid by the county.
K.S.A. 28-150