The computer does hear and is aware of the output of sound being made. It makes no difference that sound isn't sent to the BBC BASIC program.
A computer can be programmed to 'listen' and 'interpret' using the microphone. Dragon Naturally Speaking software was a great tool for speaking to my computer and it would type what I said. (it cost me a lot of money many years ago)
Unfortunately, I can not believe that a computer could have self awareness, mainly because I have watched countless videos from many high profile
programmers, scientists, doctors, surgeons, and pretty well everything you could possibly imagine over many years. ( ever since around 1982 or earlier)
Think about this ….
Microsoft, Google, Apple and other companies have spent huge amounts of money on AI for interacting with users of thier products.
The examples they have provided on YouTube show that they are a LONG way from achieving anything spectacular. (in my opinion)
All you need to do is use Windows 10 and the AI they provide with it. (In my opinion its not that good)
And they use huge systems to manage the interactions.
When I read " It makes no difference that sound isn't being sent to the BBC BASIC program" , I would be a tad concerned about everything.
Focus is on code subject. Feel free to judge the quality of my work.