We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee05058 commit a0d7af3Copy full SHA for a0d7af3
test/test_encoders.py
@@ -263,3 +263,13 @@ def test_num_channels(
263
if num_channels_output is None:
264
num_channels_output = num_channels_input
265
assert self.decode(encoded_source).shape[0] == num_channels_output
266
+
267
+ def test_1d_samples(self):
268
+ # smoke test making sure 1D samples are supported
269
+ samples_1d, sample_rate = torch.rand(1000), 16_000
270
+ samples_2d = samples_1d[None, :]
271
272
+ torch.testing.assert_close(
273
+ AudioEncoder(samples_1d, sample_rate=sample_rate).to_tensor("wav"),
274
+ AudioEncoder(samples_2d, sample_rate=sample_rate).to_tensor("wav"),
275
+ )
0 commit comments