Skip to content

Commit a08a8b3

Browse files
committed
Fix
1 parent cd1fee0 commit a08a8b3

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

test/smoke_test.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ def test_video_and_audio_chunked(self, tmp_path):
240240
frames = torch.randint(
241241
0, 256, (NUM_FRAMES, 3, HEIGHT, WIDTH), dtype=torch.uint8
242242
)
243+
sr = 44100
243244
samples = torch.rand(NUM_AUDIO_CHANNELS, NUM_SAMPLES) * 2 - 1
244245
path = tmp_path / "av.mkv"
245246

@@ -251,7 +252,7 @@ def test_video_and_audio_chunked(self, tmp_path):
251252
pixel_format="yuv444p",
252253
crf=0,
253254
)
254-
audio = enc.add_audio(sample_rate=SAMPLE_RATE, num_channels=NUM_AUDIO_CHANNELS)
255+
audio = enc.add_audio(sample_rate=sr, num_channels=NUM_AUDIO_CHANNELS)
255256
enc.open(dest=path)
256257
with enc:
257258
video.write(frames[:5])
@@ -266,11 +267,11 @@ def test_video_and_audio_chunked(self, tmp_path):
266267

267268
audio_dec = AudioDecoder(path)
268269
assert audio_dec.metadata.num_channels == NUM_AUDIO_CHANNELS
269-
assert audio_dec.metadata.sample_rate == SAMPLE_RATE
270+
assert audio_dec.metadata.sample_rate == sr
270271
decoded_samples = audio_dec.get_all_samples()
271272
assert decoded_samples.data.shape[0] == NUM_AUDIO_CHANNELS
272-
assert decoded_samples.sample_rate == SAMPLE_RATE
273273
# TODO: validate audio on a mostly lossless codec?
274+
assert decoded_samples.sample_rate == sr
274275

275276
@pytest.mark.needs_cuda
276277
def test_cuda_encoding(self, tmp_path):

0 commit comments

Comments
 (0)