I'm trying to generate sound via piping the output for python to aplay like this:
python test.py | aplay
My python code looks like this:
for i in range (0, 1000):
for j in range (0, 256):
print(chr(j), end="")
Because the way aplay works (turning raw data to unsigned 8bit, 8000Hz audio) I assumed that it would play a sawtooth wave for 1000 period on (8000/256=) 31.25 Mhz.
However when I meassured the output frequency with a tune, it gave me around 20Mhz and I have absolutely no idea where I went wrong with this.