Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6126911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:26:16+00:00 2026-05-23T16:26:16+00:00

I am trying to use portaudio (being cross platform capability), to read in from

  • 0

I am trying to use portaudio (being cross platform capability), to read in from microphone, then i want to put that data through a FFT, but i am not so sure how to do it.
Alot of people have told me: 1.get the data, 2.apply fft,
but the problem is i am not so sure how to get the data, portaudio doesn’t have much tutorials on grabbing input from mic, if you know any code, tutorials or any other resource it would be great full. I been searching on this for a while now. Please help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:26:16+00:00Added an answer on May 23, 2026 at 4:26 pm

    The portaudio distribution has documentation in the form of example C programs. They are in the test directory and are usually called patest_.... There is lots of good material there and the docs contain an overview with very short description,

    The one you want to look at is patest_record, which does asynchronous recording via a call-back. This is the way to go if you want to do anything serious, IMHO. But there is also patest_read_record.c, which does synchronous (blocking) IO.

    The code is actually very easy, here are the relevant parts (lots of stuff left out):
    1/ you malloc a buffer 2/ you install a callback 3/ in the callback, you copy the data to your buffer

    /* 1 */ 
    data.recordedSamples = (SAMPLE *) malloc( numBytes );
    /* 2 */
    err = Pa_OpenStream(
              &stream,
              &inputParameters,
              NULL,                  /* &outputParameters, */
              SAMPLE_RATE,
              FRAMES_PER_BUFFER,
              paClipOff,      
              recordCallback,
              &data );  
     /* 3, in recordCallBack with rptr the input data and wptr our buffer */
     for( i=0; i<framesLeft; i++ )
     {
         *wptr++ = *rptr++;  /* left */
         if( NUM_CHANNELS == 2 ) *wptr++ = *rptr++;  /* right */
     }
    

    Again, this is simplified, but you get the idea. There is a fair amount of bookkeeping and the sample code isn’t the squeeky cleanest, but it is easy to adapt to your purposes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
I am trying use Date Picker and on Select i want to display the
I want use localized strings from resources in xsl template as in aspx page,
I'm trying use this code to get image resolution from file bool GetImageSizeEx(const char
I am trying use std::copy to copy from two different iterator. But during course
I'm trying use to selenium with firefox on CentOS from command line like this:
I'm trying use eco for client-side templating. I have multiple .eco templates that I'd
i'm trying use webview to load a image from sdcard i use this path
I have a regex that I'm trying use to validate against strings. Trying to
I have a 3rd party DLL that I am trying to use in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.