While I don’t need or indeed use sound at my computer (due to a hearing problem), I recognized that this might be a little bit easier using sed.
As far as I can tell, you only need one command, and it proved so according to this page:
sudo sed -i 's/time.clock/time.perf_counter/g' '/usr/lib/python3.9/site-packages/kazam/pulseaudio/pulseaudio.py'
This uses Stream EDitor (sed) as follows:
sed -i 's/old-text/new-text/g' input.txt
1.1 The s is the substitute command of sed for find and replace.
1.2. It tells sed to find all occurrences of ‘time.clock’ and replace with ‘time.perf_counter’ in the file /usr/lib/python3.9/site-packages/kazam/pulseaudio/pulseaudio.py.
Or that’s my, admittedly limited, understanding any way.
I’m an editor here on the site and I’m going through all of the tutorials here and adding a difficulty level for all of them. If you disagree with my 1 star, feel free to change that or remove it altogether: You are in control! (I just want to avoid N00bs who don’t know the difference between UEFI and BIOS to get their heads too deep in… erm… YKWIM )
I’ve also improved the readability of your post by:
Using the third person
Numbering items so if anyone ever runs into an issue, they can say “While executing step #5, I get Flux capacitor not installed. What should I do?”
used correct indentation
removed some minor spelling and/or grammar errors.
If you want to review all of the changes I made, just press the orange pencil in the top right of your post…
P.S. @Mirdarthos your excellent propositions included as well.