Date: May 20, 2025 (Tue)
Version: Prototype
Freesound-CLI-Prototype-demo.mp4
This project provides a command-line interface (CLI) to browse, preview, inspect, and download sounds from FreeSound.org. It's built with Python and utilizes rich for a user-friendly console experience and sounddevice for audio playback.
https://freesound.org/docs/api/
- Query: Search for sounds using keywords.
- Paginate: Navigate through search results page by page.
- Preview: Play MP3 previews of sounds directly in the terminal, with seeking capabilities.
- Inspect: View detailed information about a selected sound.
- Download: Download MP3 previews of sounds.
play #orp #: Play a sound by index.play rorp r: Play a random sound from the current page.inspect #ori #: View details of a sound by index.download #ord #: Download a sound by index.prevor<: Go to the previous page.nextor>: Go to the next page.go #org #: Go to a specific page.go rorg r: Go to a random page.restartorr: Start a new search.quitorq: Exit the application.clearorc: Clear the console screen.
- To-do: Option for OAuth2 Authentication in addition to Token Authentication.
- To-do: Original file download.
- To-do: Options for Audio analysis.
Before running the FreeSound CLI, ensure you have Python 3.11 or newer installed.
git clone [https://github.com/luklongman/freesound-cli-prototype.git](https://github.com/luklongman/freesound-cli-prototype.git)
cd freesound-cli-prototypepython -m venv venv
source venv/bin/activate # On Windows: .\venv\Scripts\activateThis project uses a requirements.txt file to manage its dependencies. Install them using pip:
pip install -r requirements.txtThis will install all required packages including requests, python-dotenv, rich, sounddevice, soundfile, and numpy.
- Go to the FreeSound Developers website.
- Create a new application to obtain your API key.
- Create a file named .env in the root directory of the project (where requirements.txt is located).
- Add your API key to the .env file in the following format:
FREESOUND_API_KEY=your_actual_api_key_here
sounddevice relies on PortAudio. You'll need to install it separately depending on your operating system. macOS (using Homebrew):
brew install portaudioDebian/Ubuntu:
sudo apt-get install libportaudio2Windows: You might need to download the PortAudio binaries and place them in your system's PATH or in the same directory as your Python script. Refer to the python-sounddevice documentation for more detailed instructions specific to Windows.