Metadata-Version: 2.1
Name: audio-extract
Version: 0.1.0
Summary: Extract and trim audio from videos or trim audios.
Home-page: https://github.com/riad-azz/py-audio-extract
Author: riad-azz
Author-email: riadh.azzoun@hotmail.com
License: MIT License
Project-URL: Source, https://github.com/riad-azz/py-audio-extract
Keywords: convert video,audio,ffmpeg,video to mp3
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.11
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Multimedia
Classifier: Topic :: Multimedia :: Sound/Audio
Classifier: Topic :: Multimedia :: Video
Classifier: Topic :: Multimedia :: Video :: Conversion
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: ffmpeg (>=1.4)
Requires-Dist: imageio-ffmpeg (>=0.4.8)
Requires-Dist: mutagen (>=1.46.0)
Requires-Dist: py-file-type (>=0.1.0)

# Audio Extract

Extract and trim audio from videos or trim audios.

## Description

Audio Extract allows you to extract audio from video files and trim the audio according to your needs.
It supports various video and audio formats and has a simple and user-friendly interface.

It can also be used to trim audios.

## Installing

```bash
pip install audio-extract
```

## Executing the program

#### Extract full audio

```python
import audio_extract as audio_extract

audio_extract.run(input_path="./video.mp4", output_path="./audio.mp3")
```

This will create a mp3 file called `audio.mp3` that contains the full audio of the video file `video.mp4`.

#### Extract sub clip audio

```python
import audio_extract as audio_extract

audio_extract.run(input_path="./video.mp4", output_path="./audio.mp3", start_time="00:30")
```

This will create a mp3 file called `audio.mp3` that starts after the first 30 seconds of the video file `video.mp4`.

#### Extract sub clip audio with custom duration

```python
import audio_extract

audio_extract.run(input_path="./video.mp4", output_path="./audio.mp3", start_time="00:25", duration="01:15")
```

This will convert video file `video.mp4` to a mp3 file starting from `00:25` to `01:15`
called `audio.mp3` that will have a duration of `00:50`.

#### Trim audio

```python
import audio_extract

audio_extract.run(input_path="./audio.mp3", output_path="./new_audio.mp3", start_time="00:05", duration="01:15")
```

This will trim the `audio.mp3` file starting from `00:05` to `01:15`  to a mp3 file called `new_audio.mp3` that will
have a duration of `01:10`.

## Authors

Riadh Azzoun - [@riad-azz](https://github.com/riad-azz)

## License

This project is licensed under the [MIT] License - see the LICENSE.md file for details
