[GH-ISSUE #1915] infer/lib/audio.py: audio2(): av.open(..., "rb"|"wb"): ValueError: mode must be 'r', 'w', or None, got: rb #1291

Closed
opened 2026-10-20 10:07:43 +00:00 by bsakaguchi · 7 comments
Owner

Originally created by @dimgel on GitHub (Mar 23, 2024).
Original GitHub issue: https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/issues/1915

Hi. Got error when trying "Model Inference" tab, had to patch subj to get it working:

-   inp = av.open(i, "rb")
-   out = av.open(o, "wb", format=format)
+   inp = av.open(i, "r")
+   out = av.open(o, "w", format=format)

It was just a guess. I don't know python, couldn't find API docs nor what "b" means. "Binary"? Ha, can it also process text files? :)

Also hit #1155 on first run, 1st comment there helped. Didn't try anything else yet.

ArtixLinux, python 3.11.8, ffmpeg 6.1.1 & 4.4.4, nvidia blob.

Originally created by @dimgel on GitHub (Mar 23, 2024). Original GitHub issue: https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/issues/1915 Hi. Got error when trying "Model Inference" tab, had to patch subj to get it working: - inp = av.open(i, "rb") - out = av.open(o, "wb", format=format) + inp = av.open(i, "r") + out = av.open(o, "w", format=format) It was just a guess. I don't know python, couldn't find API docs nor what "b" means. "Binary"? Ha, can it also process text files? :) Also hit #1155 on first run, 1st comment there helped. Didn't try anything else yet. ArtixLinux, python 3.11.8, ffmpeg 6.1.1 & 4.4.4, nvidia blob.
bsakaguchi 2026-10-20 10:07:43 +00:00
  • closed this issue
  • added the
    stale
    label
Author
Owner

@WuYuZh17 commented on GitHub (Mar 23, 2024):

I meet that question too.In python,"rb"means you need to read a binary file.In function "open" it works,so I guess that's the question of av library.I want to solve that too:(

<!-- gh-comment-id:2016540484 --> @WuYuZh17 commented on GitHub (Mar 23, 2024): I meet that question too.In python,"rb"means you need to read a binary file.In function "open" it works,so I guess that's the question of av library.I want to solve that too:(
Author
Owner

@dimgel commented on GitHub (Mar 23, 2024):

I want to solve that too:(

Then just remove "b" like I did -- and it will work.

<!-- gh-comment-id:2016558869 --> @dimgel commented on GitHub (Mar 23, 2024): > I want to solve that too:( Then just remove "b" like I did -- and it will work.
Author
Owner

@WuYuZh17 commented on GitHub (Mar 26, 2024):

thanks a lot,that works,but I meet the question"UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in position 25: illegal multibyte sequence",could you help me please:(

<!-- gh-comment-id:2020585239 --> @WuYuZh17 commented on GitHub (Mar 26, 2024): thanks a lot,that works,but I meet the question"UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in position 25: illegal multibyte sequence",could you help me please:(
Author
Owner

@dimgel commented on GitHub (Mar 30, 2024):

Sorry, not my area of expertise.

<!-- gh-comment-id:2027983208 --> @dimgel commented on GitHub (Mar 30, 2024): Sorry, not my area of expertise.
Author
Owner

@JarrodElliott commented on GitHub (Apr 23, 2024):

@dimgel, @WuYuZh17: Looks like this commit makes it so you can't use 'rb' in the open anymore which was being used in the latest release here.

Try installing an older version - PyAV v11.0.0
pip install --force-reinstall -v "av==11.0.0"

<!-- gh-comment-id:2073585668 --> @JarrodElliott commented on GitHub (Apr 23, 2024): @dimgel, @WuYuZh17: Looks like [this commit](https://github.com/PyAV-Org/PyAV/commit/39832c4f9eacc0319eb3dea8c48814cf678f53a6) makes it so you can't use 'rb' in the open anymore which was being used in the latest release here. Try installing an older version - [PyAV v11.0.0](https://github.com/PyAV-Org/PyAV/releases/tag/v11.0.0) `pip install --force-reinstall -v "av==11.0.0"`
Author
Owner

@admarsee commented on GitHub (Apr 23, 2024):

@JarrodElliott , downgrading av from 12 to 11 fixed the issue for me!

<!-- gh-comment-id:2073609446 --> @admarsee commented on GitHub (Apr 23, 2024): @JarrodElliott , downgrading av from 12 to 11 fixed the issue for me!
Author
Owner

@RVC-Boss commented on GitHub (Jul 20, 2026):

You can update the code to the latest main branch, where this issue has already been resolved.

<!-- gh-comment-id:5019814019 --> @RVC-Boss commented on GitHub (Jul 20, 2026): You can update the code to the latest `main` branch, where this issue has already been resolved.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
RVC-Project/Retrieval-based-Voice-Conversion-WebUI#1291
No description provided.