import itertools


def create_samples(channels, nsamples=-1):
    """
    Creates samples out of multiple channels
    :param channels: a list of iterators containing a wave data
    :param nsamples: the width of each sample
    :return: an iterator of samples
    """
    return itertools.islice(zip(*channels), nsamples)