Skip to content

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

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

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