import math


def GetSampleRange(freq, duration_sec, start_sec):
  """Creates index range [start, end) for a chunk given span and frequency."""
  chunk_start_sample = int(math.floor(freq * start_sec))
  chunk_end_sample = int(math.floor(freq * duration_sec + chunk_start_sample))
  return (chunk_start_sample, chunk_end_sample)