# Merge audio Learn how to merge audio files, combine MP3 files into one file programmatically in Python using GroupDocs.Merger for Python via .NET. GroupDocs.Merger for Python via .NET combines audio files in the order you join them and saves them as one audio file, with no desktop audio software involved. Audio files are joined with files of the same format: MP3 with MP3, or WAV with WAV. ## How to merge MP3 files in Python 1. Create an instance of the `Merger` class and pass the path to the first audio file. 2. Call `merger.join()` with the path to each audio file to append. Each one must be of the same format as the first. 3. Call `merger.save()` with the path of the merged audio file. {{< tabs "merge-audio-example" >}} {{< tab "merge_mp3_files.py" >}} ```python from groupdocs.merger import Merger def merge_mp3_files(): # Load the first MP3 file with Merger("./input.mp3") as merger: # Append the second MP3 file merger.join("./input2.mp3") # Save the merged audio merger.save("./output.mp3") if __name__ == "__main__": merge_mp3_files() ``` {{< /tab >}} {{< tab "input.mp3" >}} {{< tab-text >}} `input.mp3` is a sample file used in this example. Click [here](https://docs.groupdocs.com/merger/python-net/_sample_files/developer-guide/merge/audio/input.mp3) to download it. {{< /tab-text >}} {{< /tab >}} {{< tab "input2.mp3" >}} {{< tab-text >}} `input2.mp3` is a sample file used in this example. Click [here](https://docs.groupdocs.com/merger/python-net/_sample_files/developer-guide/merge/audio/input2.mp3) to download it. {{< /tab-text >}} {{< /tab >}} {{< tab "output.mp3" >}} ```text Binary file (MP3, 88 KB) ``` [Download full output](https://docs.groupdocs.com/merger/python-net/_output_files/developer-guide/merge/audio/merge_mp3_files/output.mp3) {{< /tab >}} {{< /tabs >}} ### Explanation - **Load the first file**: `Merger("./input.mp3")` opens the first MP3 file inside a context manager. Its audio comes first in the result. - **Append another file**: `merger.join("./input2.mp3")` appends the second file's audio after the first. Call `join` again for each additional file. - **Save the result**: `merger.save("./output.mp3")` writes the merged audio to disk. {{< alert style="warning" >}} Joining an audio file into a format it cannot be joined into (for example, a WAV file into an MP3 file) raises `FileTypeNotSupportedException` (from `groupdocs.merger.exceptions`): "Joining 'Wav' into 'Mp3' is not supported". {{< /alert >}} ### Merge audio Live Demo GroupDocs.Merger provides free online [**MP3 Merger App**](https://products.groupdocs.app/merger/mp3) and [**WAV Merger App**](https://products.groupdocs.app/merger/wav), which allow you to try it and check its quality. ## API reference - [`Merger`](https://reference.groupdocs.com/merger/python-net/groupdocs.merger/merger/) — main class; `join`, `save` methods. - [`FileTypeNotSupportedException`](https://reference.groupdocs.com/merger/python-net/groupdocs.merger.exceptions/filetypenotsupportedexception/) — raised for a join the formats do not allow. ## See also - [Merge archives]({{< ref "merger/python-net/developer-guide/merge/archives.md" >}}) - [Supported document formats]({{< ref "merger/python-net/getting-started/supported-document-formats.md" >}}) - [More use-cases and complete Python via .NET sources]({{< ref "merger/python-net/showcases.md" >}})