class_docstr: tests for AudioFrame
class_docstr_tok: ["tests","for","AudioFrame"]
code: def test_ndarray_methods(self):
      # pylint: disable=protected-access
      data = np.array([0, 0.707, 1, 0.707, 0, -0.707, -1, -0.707, 0])
      frame = AudioFrame(
          data, sample_rate=11025, timestamp=1, layout="stereo"
      )
      self.assertEqual(frame.sample_rate, 11025)
      self.assertEqual(frame.timestamp, 1)
      self.assertEqual(frame.layout, "stereo")
      self.assertListEqual(list(frame.shape), [9])
      self.assertEqual(frame.sum(), 0)
  
      arr = np.zeros(9)
      frame_arr = arr.view(AudioFrame)
      self.assertListEqual(list(frame_arr.shape), [9])
      self.assertEqual(frame_arr.sum(), 0)
      self.assertEqual(frame_arr.sample_rate, None)
      self.assertEqual(frame_arr.timestamp, None)
      self.assertEqual(frame_arr.layout, None)
  
      clip = frame[:4]
      self.assertListEqual(list(clip.shape), [4])
      self.assertEqual(clip.sample_rate, 11025)
      self.assertEqual(clip.timestamp, 1)
  
imports: import unittest
  import numpy
  from towhee.types import AudioFrame
label_desc: Use image node_id 1 for calling the TestAudioFrame obj's underlying member method code with example usage: obj.test_ndarray_methods() without return types