This commit is contained in:
billypom on debian 2025-03-25 22:08:46 -04:00
parent b552d384ca
commit 9b5e635a6e
2 changed files with 5 additions and 5 deletions

View File

@ -176,9 +176,10 @@ class ApplicationWindow(QMainWindow, Ui_MainWindow):
# Graphics plot
self.PlotWidget.setXRange(0, 100, padding=0) # x axis range
self.PlotWidget.setYRange(0, 1, padding=0) # y axis range
self.PlotWidget.setLogMode(False, False)
self.PlotWidget.setMouseEnabled(x=False, y=False)
self.PlotWidget.getAxis("bottom").setTicks([]) # Remove x-axis ticks
self.PlotWidget.getAxis("bottom").setLabel("") # Remove x-axis label
self.PlotWidget.setLogMode(False, False)
# Remove y-axis labels and decorations
self.PlotWidget.getAxis("left").setTicks([]) # Remove y-axis ticks
self.PlotWidget.getAxis("left").setLabel("") # Remove y-axis label
@ -392,7 +393,7 @@ class ApplicationWindow(QMainWindow, Ui_MainWindow):
self.clear_audio_visualization()
y = self.audio_visualizer.get_amplitudes()
x = [i for i in range(len(y))]
self.PlotWidget.setLogMode(True, True)
# x = nparray([0, 31.25, 62.5, 125, 250, 500, 1000, 2000, 4000, 8000, 15000, 20000])
self.PlotWidget.plot(x, y, fillLevel=0, fillBrush=mkBrush("b"))
self.PlotWidget.show()

View File

@ -6,11 +6,11 @@ from PyQt5 import QtCore
from pydub import AudioSegment
import numpy as np
from scipy.ndimage.filters import gaussian_filter1d
from logging import debug
from logging import debug, info
class FFTAnalyser(QtCore.QThread):
"""Analyses a song on a playlist using FFTs."""
"""Analyses a song using FFTs."""
calculated_visual = QtCore.pyqtSignal(np.ndarray)
@ -57,7 +57,6 @@ class FFTAnalyser(QtCore.QThread):
freq = np.fft.fftfreq(fourier.size, d=0.05)
amps = 2 / v_sample.size * np.abs(fourier)
data = np.array([freq, amps]).T
# info(data)
point_range = 1 / self.resolution
point_samples = []