# AudioEditingCode Colab Demo This notebook demonstrates how to use the `AudioEditingCode` repository in Google Colab. ## 1. Clone the repository ```bash !git clone https://github.com/HilaManor/AudioEditingCode.git %cd AudioEditingCode ``` ## 2. Install dependencies ```bash !pip install -r requirements.txt ``` ## 3. Demo Usage Here you can add examples of how to use the code. You might need to download some audio files for demonstration. ### Download example audio ```bash !wget https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3 -O input_audio.mp3 ``` ### Text-Based Editing Example This example uses `main_run.py` for text-based audio editing. You will need a Hugging Face token to use models like Stable Audio Open. Please visit [Hugging Face](https://huggingface.co/settings/tokens) to get your token and replace `` below. ```python import os # Replace with your actual Hugging Face token os.environ["HF_TOKEN"] = "" !python code/main_run.py \ --cfg_tar 1.5 \ --cfg_src 0.5 \ --init_aud input_audio.mp3 \ --target_prompt "a dog barking" \ --tstart 100 \ --model_id audioldm \ --results_path results_text_based ``` ### Unsupervised Editing Example First, extract the principal components: ```bash !python code/main_pc_extract_inv.py \ --init_aud input_audio.mp3 \ --model_id audioldm \ --results_path results_unsupervised_extract \ --drift_start 0 \ --drift_end 200 \ --n_evs 5 ``` Then, apply the principal components: ```bash !python code/main_pc_apply_drift.py \ --extraction_path results_unsupervised_extract/input_audio_audioldm_inversion_data.pt \ --drift_start 0 \ --drift_end 200 \ --amount 1.0 \ --evs 0 ```