# AI Audio Authenticator ## Overview The AI Audio Authenticator is a Python tool designed to analyze audio files and determine the likelihood that they were generated by an AI system. It uses spectral analysis and machine learning techniques to detect artifacts typical of AI-generated audio, such as pitch inconsistencies and spectral anomalies. ## Features - Extracts audio features such as spectral centroid, bandwidth, rolloff, and zero-crossing rate. - Generates spectrogram visualizations for audio files. - Uses a simulated machine learning model to predict the likelihood of AI-generated audio. ## Installation To use this tool, you need to have Python installed on your system. Install the required dependencies using pip: ```bash pip install librosa numpy matplotlib scikit-learn ``` ## Usage Run the tool from the command line with the following options: ```bash python ai_audio_authenticator.py --input [--plot] ``` ### Arguments - `--input`: Path to the input audio file (required). - `--plot`: Optional flag to generate a spectrogram visualization of the audio file. ### Example ```bash python ai_audio_authenticator.py --input example.wav --plot ``` This will analyze the `example.wav` file and output the confidence score that the audio is AI-generated. If the `--plot` flag is provided, a spectrogram image will also be saved in the same directory as the input file. ## Testing To run the tests, install `pytest` and execute the following command: ```bash pytest test_ai_audio_authenticator.py ``` The tests include: - Verifying that audio features are correctly extracted. - Ensuring that spectrogram generation works as expected. - Testing the analysis function with mocked data. ## Limitations - The machine learning model used in this tool is a placeholder and not trained on actual AI-generated audio data. For real-world applications, you would need to train the model on a labeled dataset of human and AI-generated audio samples. ## License This project is licensed under the MIT License.