Skip to content

Reading audio requires a copy #237

@maelp

Description

@maelp

Steps to reproduce

AudioSegment.from_file()

Expected behavior

It should load the audio efficiently

Actual behavior

It copies all the audio to a temporary file, then converts the temporary file to wav in a second temporary file, then load the wav

input_file = NamedTemporaryFile(mode='wb', delete=False)

This can be needed if we give a file descriptor as input to the from_file method, but for the common case where the input is a filename, it should be used without copying in a first temporary file

Your System configuration

  • Python version:
  • Pydub version:
  • ffmpeg or avlib?:
  • ffmpeg/avlib version:

Is there an audio file you can include to help us reproduce?

You can include the audio file in this issue - just put it in a zip file and drag/drop the zip file into the github issue.

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