- /
- 
        Audio Visualizer
        on 13 Oct 2024
        
        
 
    - 12
- 121
- 0
- 0
- 291
 Cite your audio source here (if applicable): BGM by OtoLogic(CC BY 4.0). https://otologic.jp/free/se/school_bell01.html
drawframe(1);
 Write your drawframe function below
function drawframe(f)
    persistent y Fs t p
    if f == 1
        [y, Fs] = audioread("audio.wav");
        t = 0 : seconds(1/Fs) : seconds(4);
        p = plot(seconds(0), 0);
        hold on
        xlabel('Time');
        ylabel('Audio Signal');
        xlim([-seconds(0.04) seconds(4.04)]);
        ylim([-0.14 0.14]);
    end
    d = round(Fs * f / 24);
    p.delete
    p = plot(t(1:d), y(1:d), 'Color', '#0072BD');
end


 

