c++ - Blocking I/O in portaudio -


After trying something wrong with portaudio in my spare time, I tried to broadcast a microphone Open, I've written a callback to do this - Callback only opens an output stream and then I use Portaudio's record callback. If the sample format for output is defined paFloat32 has not heard anything, but if I define it on paUInt8 and in the number of channel 1, then I hear a voice I (like the beep), but the detection of pitch (using FFT) is not equal to the frequency I transmit. So my question is that FFT has been implemented incorrectly (or - is it possible to use paUint8 and still get the correct answer) or should I try to block I / O?

some code help):

This is the output parameter for the output stream (input stream recording is from the example).

  outputParameters.device = Pa_GetDefaultOutputDevice (); OutputParameters.channelCount = 1; Output Parameters.sampleFormat = paUInt8; OutputParameters.suggestedLatency = Pa_GetDeviceInfo (outputParameters.device) - & gt; Default low output latency; Output Parameters.hostApiSpecificStreamInfo = NULL; It is an explanation of why it is possible to communicate with   

PS : paUInt8 , although I have read 2 callbacks (1 And write for one).

It is impossible to know that the problem is without any further code, but I can say something Things:

  • Switching to block will not make any difference in resolving your issue.

  • If you do not listen to anything while doing PaFloat32, you probably are doing something wrong because the support of paFloat32 is extremely good. The range of floating point types is between -1 and 1. Make sure that you are outputting. You can also try some great code samples included with PortAudio. Use callback to see output using Palphat 32 and see if it works (like).

  • If you are getting a wrong pitch with your FFT detection, then you're probably doing it wrong too. There are two possibilities: 1. Pitch is not like that in your opinion, and 2. It is wrong to detect your FFT pitch without code, I can only guess, but since everyone has the basis of questions on # 2 (SO On), I think that you have the least problem.

    To find the FFT pitch, complete my blog entry with the code (also uses portodio)

    To make the right pitch, here are a lot of questions.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -