Hi, I would like to build a spectrum analyser with Scroll pHAT and pHAT DAC just like the tutorial in Pimoroni (https://learn.pimoroni.com/tutorial/sandyj/scroll-phat-spectrum-analyser). However, I want to analyse real time audio from a speech synthesis program (flite) on my Raspberry Pi Zero, instead of a wav file. What should I do to accomplish this in terms of the coding? Based on the tutorial, is the code below where I might have to modify?
sample_rate = wavfile.getframerate() no_channels = wavfile.getnchannels() chunk = 4096 output = aa.PCM(aa.PCM_PLAYBACK, aa.PCM_NORMAL) output.setchannels(no_channels) output.setrate(sample_rate) output.setformat(aa.PCM_FORMAT_S16_LE) output.setperiodsize(chunk)
I appreciate any advice on how I can go about working on this. Thanks!