Skip to main content

Text-to-Audio Generation

arXiv githubio Hugging Face Spaces Open In Colab Replicate

Generate speech, sound effects, music and beyond.


Important tricks to make your generated audio sound better

  1. Try to use more adjectives to describe your sound. For example: "A man is speaking clearly and slowly in a professional studio" is better than "A man is speaking". This can make sure AudioLDM understand what you want.
  2. Try to use different random seeds, which can affect the generation quality significantly sometimes.
  3. It's best to use general terms like 'man' or 'woman' instead of specific names for individuals or abstract objects that humans may not be familiar with, such as 'mummy'.

Change Log

2023-02-15: Add audio style transfer. Add more options on generation.

Web APP

  1. Prepare running environment
conda create -n audioldm python=3.8; conda activate audioldm
pip3 install audioldm==0.0.6
git clone https://github.com/haoheliu/AudioLDM; cd AudioLDM
  1. Start the web application (powered by Gradio)
python3 app.py
  1. A link will be printed out. Click the link to open the browser and play.

Commandline Usage

  1. Prepare running environment
# Optional
conda create -n audioldm python=3.8; conda activate audioldm
# Install AudioLDM
pip3 install audioldm==0.0.6
  1. text-to-audio generation
# Test run
audioldm -t "A hammer is hitting a wooden surface" # The default --mode is "generation"
  1. audio-to-audio style transfer
# Test run
# --file_path is the original audio file for transfer
# -t is the text AudioLDM uses for transfer. 
# Please make sure that --file_path exist
audioldm --mode "transfer" --file_path trumpet.wav -t "Children Singing" 

For more options on guidance scale, batchsize, seed, ddim steps, etc., please run

audioldm -h

For the evaluation of audio generative model, please refer to audioldm_eval.

Web Demo

Integrated into Hugging Face Spaces 🤗 using Gradio. Try out the Web Demo Hugging Face Spaces

TODO

  • Update the checkpoint with more training steps.
  • Add AudioCaps finetuned AudioLDM-S model
  • Build pip installable package for commandline use
  • Build Gradio web application
  • Add text-guided style transfer
  • Add audio super-resolution
  • Add audio inpainting

Cite this work

If you found this tool useful, please consider citing

@article{liu2023audioldm,
  title={AudioLDM: Text-to-Audio Generation with Latent Diffusion Models},
  author={Liu, Haohe and Chen, Zehua and Yuan, Yi and Mei, Xinhao and Liu, Xubo and Mandic, Danilo and Wang, Wenwu and Plumbley, Mark D},
  journal={arXiv preprint arXiv:2301.12503},
  year={2023}
}

Hardware requirement

  • GPU with 8GB of dedicated VRAM
  • A system with a 64-bit operating system (Windows 7, 8.1 or 10, Ubuntu 16.04 or later, or macOS 10.13 or later) 16GB or more of system RAM

Reference

Part of the code is borrowed from the following repos. We would like to thank the authors of these repos for their contribution.

https://github.com/LAION-AI/CLAP

https://github.com/CompVis/stable-diffusion

https://github.com/v-iashin/SpecVQGAN

https://github.com/toshas/torch-fidelity

We build the model with data from AudioSet, Freesound and BBC Sound Effect library. We share this demo based on the UK copyright exception of data for academic research.

Release files for audioldm 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for audioldm 0.0.8
File Size Uploaded
audioldm-0.0.8.tar.gz 1.5 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for audioldm 0.0.8
File Interpreter ABI Platform
audioldm-0.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 3.0 MB

Release files / audioldm-0.0.8.tar.gz

Download URL audioldm-0.0.8.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
e84d2bdc978e1cc1a86e19b1182aaee43da16024506cc62b9be3efb37401436c
BLAKE2b-256 checksum
How to use checksums
4f3c9b40f6ce0ec429cc04003b8dfeceffb2cad572253a8bcc8a7be393726412
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.15

Release files / audioldm-0.0.8-py3-none-any.whl

Download URL audioldm-0.0.8-py3-none-any.whl
Size 1.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
75160741c335bfeafe3a07656b843d43d4f48f18b4888e263a567551254bff52
BLAKE2b-256 checksum
How to use checksums
a1dbc2f892ab74b2924375f97df9fb047746f91d00590b120b403f733b4f2fc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.15

Release history Release notifications | RSS feed

0.1.1

2 release files

0.1.0

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

This release

0.0.8 This release

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page