Skip to content

Commit 0319725

Browse files
authored
Merge pull request #464 from Renumics/fix/pyav-breaking-changes
Fix/pyav breaking changes
2 parents 2819384 + 4d6da91 commit 0319725

File tree

3 files changed

+28
-70
lines changed

3 files changed

+28
-70
lines changed

poetry.lock

Lines changed: 19 additions & 59 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pandas = "*"
7474
importlib_resources = "<5.8.0"
7575
scikit-image = "*"
7676
imagecodecs = [{ version = "*", markers = 'platform_machine != "arm64"' }]
77-
av = "<13.0.0"
77+
av = "*"
7878
validators = "*"
7979
ipywidgets = "*"
8080
jinja2 = "*"
@@ -107,7 +107,6 @@ types-requests = "^2.27.20"
107107
black = "^24.1.1"
108108
pytest = "^7.4.2"
109109
ipython = "^8.10.0"
110-
jupyter = "^1.0.0"
111110
watchdog = "^2.1.7"
112111
argh = "^0.26.2"
113112
typed-ast = "^1.5.3"
@@ -129,6 +128,7 @@ check-wheel-contents = "^0.6.0"
129128
torch = { version = "^2.1.1+cpu, <=2.4.1+cpu", source = "torch-cpu" }
130129
ray = {extras = ["data"], version = "==2.9.3"}
131130
soxr = "*"
131+
notebook = "*"
132132

133133
[tool.poetry.group.playbook.dependencies]
134134
annoy = "^1.17.2"

renumics/spotlight/io/audio.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,17 @@ def _channel_num_to_layout(channel_num: int) -> str:
3131
if channel_num == 2:
3232
return "stereo"
3333
if channel_num == 3:
34-
return "3.0"
34+
return "2.1"
3535
if channel_num == 4:
36-
return "4.0"
36+
return "3.1"
3737
if channel_num == 5:
38-
return "5.0"
38+
return "4.1"
3939
if channel_num == 6:
40-
return "6.0"
40+
return "5.1"
4141
if channel_num == 7:
42-
return "7.0"
43-
if channel_num == 8:
44-
return "7.1"
42+
return "6.1"
4543
raise ValueError(
46-
f"Only channel number from 1 to 8 are supported, but {channel_num} received."
44+
f"Only channel number from 1 to 7 supported, but value {channel_num} received."
4745
)
4846

4947

@@ -151,7 +149,7 @@ def write_audio(
151149
frame = av.audio.AudioFrame.from_ndarray(data, data_format, layout)
152150
frame.rate = sampling_rate
153151
with av.open(file, "w", format_) as container:
154-
stream = container.add_stream(codec, sampling_rate, channels=num_channels) # type: ignore[call-arg]
152+
stream = container.add_stream(codec, sampling_rate, layout=layout) # type: ignore[call-arg]
155153
container.mux(stream.encode(frame)) # type: ignore[attr-defined]
156154
container.mux(stream.encode(None)) # type: ignore[attr-defined]
157155

0 commit comments

Comments
 (0)