class_docstr: Test decoding for ArrayDecoder
class_docstr_tok: ["Test","decoding","for","ArrayDecoder"]
code: def tearDown(self):
      decoder = ArrayDecoder(
          samples=self.source,
          samplerate=self.source_samplerate,
          start=self.start,
          duration=self.duration,
      )
  
      decoder.setup(
          samplerate=self.samplerate,
          channels=self.channels,
          blocksize=self.blocksize,
      )
  
      # Check input
      self.assertEqual(self.source_samplerate, decoder.input_samplerate)
      self.assertEqual(self.expected_is_segment, decoder.is_segment)
      self.assertEqual(self.expected_duration, decoder.input_duration)
      self.assertEqual(self.source_channels, decoder.input_channels)
      # Check output
      self.assertEqual(self.source_samplerate, decoder.samplerate())
      self.assertEqual(self.source_channels, decoder.channels())
  
      # Check Idecoder interface
      self.assertIsInstance(decoder.mediainfo(), dict)
      self.assertIsInstance(decoder.format(), str)
      self.assertIsInstance(decoder.encoding(), str)
      self.assertIsInstance(decoder.resolution(), int)
      self.assertIsNone(decoder.metadata())
  
      totalframes = 0
  
      while True:
          frames, eod = decoder.process()
          totalframes += frames.shape[0]
          if eod:
              break
          self.assertEqual(frames.shape[0], decoder.blocksize())
          self.assertEqual(frames.shape[1], decoder.channels())
  
      if self.channels:
          # when specified, check that the channels are the ones requested
          self.assertEqual(self.channels, decoder.output_channels)
      else:
          # otherwise check that the channels are preserved, if not specified
          self.assertEqual(
              decoder.input_channels, decoder.output_channels
          )
          # and if we know the expected channels, check the output match
          if self.source_channels:
              self.assertEqual(
                  self.source_channels, decoder.output_channels
              )
      # do the same with the sampling rate
      if self.samplerate:
          self.assertEqual(self.samplerate, decoder.output_samplerate)
      else:
          self.assertEqual(
              decoder.input_samplerate, decoder.output_samplerate
          )
  
      self.assertEqual(
          totalframes,
          self.expected_duration * decoder.output_samplerate,
      )
      self.assertEqual(totalframes, decoder.totalframes())
  
imports: from __future__ import division
  from timeside.plugins.decoder.array import ArrayDecoder
  from unit_timeside import *
  import numpy
label_desc: Use image node_id 6 for calling the TestDecoding obj's underlying member method code with example usage: obj.tearDown() without return types