def convert_16bit_pcm_to_byte(old_value: int) -> int:
  """Converts PCM value into a byte."""

  old_min = -32768  # original 16-bit PCM wave audio minimum.
  old_max = 32768  # original 16-bit PCM wave audio max.
  new_min = 0  # new 8-bit PCM wave audio min.
  new_max = 255  # new 8-bit PCM wave audio max.
  byte_value = int((((old_value - old_min) * (new_max - new_min)) /
                    (old_max - old_min)) + new_min)
  return byte_value