Skip to content

Commit 0af41b7

Browse files
committed
fix
1 parent b6f8478 commit 0af41b7

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/torchcodec/_core/Encoder.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@ class AudioEncoder {
1111

1212
AudioEncoder(
1313
const torch::Tensor& samples,
14-
// TODO-ENCODING: update this comment when we support an output sample
15-
// rate. This will become the input sample rate.
16-
// The *output* sample rate. We can't really decide for the user what it
17-
// should be. Particularly, the sample rate of the input samples should
18-
// match this, and that's up to the user. If sample rates don't match,
19-
// encoding will still work but audio will be distorted.
2014
int sampleRate,
2115
std::string_view fileName,
2216
const AudioStreamOptions& audioStreamOptions);

test/test_encoders.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33
import re
44
import subprocess
5+
import sys
56
from functools import partial
67
from pathlib import Path
78

@@ -12,6 +13,7 @@
1213
from torchcodec.encoders import AudioEncoder
1314

1415
from .utils import (
16+
assert_tensor_close_on_at_least,
1517
get_ffmpeg_major_version,
1618
in_fbcode,
1719
NASA_AUDIO_MP3,
@@ -266,9 +268,7 @@ def test_against_cli(
266268
if sample_rate != asset.sample_rate:
267269
rtol, atol = 0, 1e-3
268270
if sys.platform == "darwin":
269-
assert_close = partial(
270-
utils.assert_tensor_close_on_at_least, percentage=99
271-
)
271+
assert_close = partial(assert_tensor_close_on_at_least, percentage=99)
272272
elif format == "wav":
273273
rtol, atol = 0, 1e-4
274274
elif format == "mp3" and asset is SINE_MONO_S32 and num_channels == 2:

0 commit comments

Comments
 (0)