Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
Output frequency and volume as float
  • Loading branch information
alorans committed Jun 27, 2024
1 parent 2f1a6ca commit 30df31e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DesmosAudio.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ def process_audio_chunk(
data = np.frombuffer(data, dtype=np.int16)

# Perform the fourier transform on the chunk
fft = np.abs(np.fft.fft(data))
fft = list(map(float, np.abs(np.fft.fft(data))))

# Get the frequencies corresponding to the FFT values
freqs = np.fft.fftfreq(len(fft), 1.0 / sample_rate)
freqs = list(map(float, np.fft.fftfreq(len(fft), 1.0 / sample_rate)))

# Combine the frequencies and FFT values into a list of tuples
chunk = list(zip(freqs, fft))
Expand Down

0 comments on commit 30df31e

Please sign in to comment.