aubio
documentation about initiating a pitch detector, https://aubio.org/doc/latest/pitch_8h.html#a962561ea270e0308ed26ac9bab554550.
- The 1st parameter is the method of the pitch detection. Up to now, I only know "DEFAULT" method. I am not sure if there is other methods and if those other methods better for my case. Nevertheless, I will keep using "DEFAULT" for now on.
- The 2nd parameter is a buffer before the sound sent to be processed.
- The 3rd parameter is said to be the interval between two consecutive sound analysis. The variable used is called
hop_size
. Other than these, I am not sure on what does this parameter do.
- In the example code
hop_size
is buffer divided by 2 and rounded up.
- The last parameter is the sample size. I do not know what does sample size do.
self.recorder = alsaaudio.PCM(
type = alsaaudio.PCM_CAPTURE
)
#variable.py
variable_text = "Hello world!"
#other.py
import variable
variable.variable_text = variable.variable_text + " Hello world again!"
#This print will result in "Hello world! Hello world again!"
print(variable.variable_text)
- So, constant can be treated as other normal Python variables. So, make sure to have use prefix
self
in variable that is class wide available.
- Screenshot to the StackOverflow Python discussion.