This Python script processes a WAV audio file to analyze and visualize its signal. It includes functionality to identify and plot peaks (S1 and S2 sounds), create a spectrogram, and print various details about the audio signal.
• Open File Dialog: Allows the user to select a WAV file from their file system.• Audio Signal Processing:
o Reads the WAV file.
o Handles both mono and stereo audio files by averaging stereo channels.
o Normalizes the audio signal.
o Extracts and plots a segment of the audio signal.
• Peak Detection: Identifies and plots peaks (S1 sounds) and valleys (S2 sounds) in the audio signal.
• Spectrogram Creation: Generates and displays a spectrogram of the audio signal.
• Signal Details: Prints detailed information about the audio signal, including frequency sampling, maximum and minimum amplitude, signal shape, data type, and duration.
• Python 3.x• numpy
• matplotlib
• scipy
• tkinter
A file dialog will appear. Select a WAV file to process.
Max Amplitude: 48782.7578125
Min Amplitude: -37955.46484375
Signal shape: 57600
Audio Signal count: (57600,)
Signal duration: 1.2 seconds



