Waveform.get_sample()

Waveform.get_sample(frame_idx, channel_idx)

Return a given audio sample belonging to a specific frame and channel.

This method performs bounds checks. If you want an unsafe method that does not perform bounds checks, use get_unchecked_sample().

Parameters
  • frame_idx – The index of the given frame to query.

  • channel_idx – the index of the given channel to query.

Returns

Returns None if frame_idx or channel_idx is out-of-bounds. Otherwise, it returns an Audio sample as a native Python 64-bit float value.