[Tutor] zero crossing pitch detection

Emile van Sebille emile at fenx.com
Sun May 29 17:11:31 CEST 2011


On 5/29/2011 12:40 AM 김태윤 said...
> hello
> I made a simple recording / pitch detecting program
> but it seems work weird way
> when I record "a~~~~~" then
> this program printing
>
> (I am not a singer and I can't go up and down G0 and C3)
>
> I am pretty sure that this is wrong result
>
> could somebody help me?

I don't see any way that G0 and C3 would print without f2hz having the 
appropriate value.  That means that your problem is with determining 
f2hz.  Looking at the code, f2hz is framerate/wholef where framerate is 
known, and wholef appears to want to be the length of the frame as you 
appear to step through the data looking for \x10\x00 tags and 
calculating a distance.

If my reading is correct, perhaps using split to break the data into 
pieces would be easier to work with?

frames = data.split('\x10\x00')


HTH,

Emile




More information about the Tutor mailing list