Skip to content

Exit code -1073741571 (0xC00000FD) when writing OGG files in-memory #466

Open

Description

@Shararamosh

I'm trying to make function that attempts to convert audio file to Vorbis OGG without losing quality, however every time I call sf.write(format="ogg") or sf.write(format="ogg", subtype="vorbis") on my audio data, I get exit code -1073741571 (0xC00000FD).
Here's my function:

def attempt_convert_to_vorbis(audio_data: np.ndarray, samplerate: int, uses_librosa_format: bool) -> None | bytes:
    if uses_librosa_format:
        audio_data = audio_data.T
    vorbis_buffer = io.BytesIO()
    for i in range(0, 101):
        print(f"{i}%.")
        sf.write(vorbis_buffer, audio_data, samplerate, format="ogg", subtype="vorbis", compression_level=0.01*i)
        print("Wrote Vorbis data to buffer.")
        vorbis_buffer.seek(0)
        vorbis_data, _ = sf.read(vorbis_buffer)
        print("Read Vorbis data from buffer.")
        if np.array_equal(audio_data, vorbis_data):
            print("Vorbis data is identical to original.")
            return vorbis_buffer.read()
    return None

Activity

  1. bastibe commented on Jul 28, 2025

    @bastibe
    Owner

    This is likely a crash in libsndfile. Please open an issue on their end.

  2. Wonderxin commented on Aug 23, 2025

    @Wonderxin

    我遇到了同样的问题,我发现写入ogg格式时,只要采样频率大于22050hz就会报这个溢出错误,我无法定位到具体位置
    16k数据可以写入成功

  3. bastibe commented on Oct 15, 2025

    @bastibe
    Owner

    Please write in English

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions