docstr: Test the case when decoder starts with a video file to decode frames, and
  audio waveform are resampled
docstr_tok: ["Test","the","case","when","decoder","starts","with","a","video","file","to","decode","frames",",","and","audio","waveform","are","resampled"]
code: def test_read_video_from_file_audio_resampling(
      self, test_video, samples
  ):
      """
      Test the case when decoder starts with a video file to decode frames, and
      audio waveform are resampled
      """
      # video related
      width, height, min_dimension, max_dimension = 0, 0, 0, 0
      video_start_pts, video_end_pts = 0, -1
      video_timebase_num, video_timebase_den = 0, 1
      # audio related
      channels = 0
      audio_start_pts, audio_end_pts = 0, -1
      audio_timebase_num, audio_timebase_den = 0, 1
  
      full_path = os.path.join(VIDEO_DIR, test_video)
  
      tv_result = torch.ops.video_reader.read_video_from_file(
          full_path,
          SEEK_FRAME_MARGIN,
          0,  # getPtsOnly
          1,  # readVideoStream
          width,
          height,
          min_dimension,
          max_dimension,
          video_start_pts,
          video_end_pts,
          video_timebase_num,
          video_timebase_den,
          1,  # readAudioStream
          samples,
          channels,
          audio_start_pts,
          audio_end_pts,
          audio_timebase_num,
          audio_timebase_den,
      )
      (
          vframes,
          vframe_pts,
          vtimebase,
          vfps,
          vduration,
          aframes,
          aframe_pts,
          atimebase,
          asample_rate,
          aduration,
      ) = tv_result
      if aframes.numel() > 0:
          assert samples == asample_rate.item()
          assert 1 == aframes.size(1)
          # when audio stream is found
          duration = (
              float(aframe_pts[-1])
              * float(atimebase[0])
              / float(atimebase[1])
          )
          assert aframes.size(0) == approx(
              int(duration * asample_rate.item()),
              abs=0.1 * asample_rate.item(),
          )
  
imports: import collections
  import math
  import os
  from fractions import Fraction
  import numpy
  import pytest
  import torch
  import torchvision.io
  from common_utils import assert_equal
  from numpy.random import randint
  from pytest import approx
  from torchvision import set_video_backend
  from torchvision.io import _HAS_VIDEO_OPT
label_desc: Use image node_id 14 for calling the TestVideoReader obj's underlying member method code with example usage: obj.test_read_video_from_file_audio_resampling(test_video, samples) without return types