def ms_to_samples(ms, sampling_rate):
    """
    Convert a duration in milliseconds into samples.

    Arguments:
        ms (float):
            Duration in ms.

        sampling_rate (int):
            Sampling rate of of the signal.

    Returns:
        int: Duration in samples.
    """
    return int((ms / 1000) * sampling_rate)