def __init__(self, samples, samplerate=<NUM_LIT>, start=<NUM_LIT:0>, duration=None):
super(ArrayDecoder, self).__init__(start=start, duration=duration)<EOL>if samples.ndim > <NUM_LIT:2>:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>if samples.ndim == <NUM_LIT:1>:<EOL><INDENT>samples = samples[:, np.newaxis]  <EOL><DEDENT>self.samples = samples.astype('<STR_LIT>')  <EOL>self.input_samplerate = samplerate<EOL>self.input_channels = self.samples.shape[<NUM_LIT:1>]<EOL>self.uri = '<STR_LIT:_>'.join(['<STR_LIT>',<EOL>'<STR_LIT:x>'.join([str(dim) for dim in samples.shape]),<EOL>samples.dtype.type.__name__])<EOL>from .utils import sha1sum_numpy<EOL>self._sha1 = sha1sum_numpy(self.samples)<EOL>self.frames = self.get_frames()<EOL>
Construct a new ArrayDecoder from an numpy array

Parameters
----------
samples : numpy array of dimension 1 (mono) or 2 (multichannel)
        if shape = (n) or (n,1) : n samples, mono
        if shape = (n,m) : n samples with m channels
start : float
    start time of the segment in seconds
duration : float
    duration of the segment in seconds