It is usually said callbacks are implemented with function pointers. When I check PortAudio's source code, I see that callback function is declared as an ordinary function (not a f. pointer). Is it n开发者_如何学Goormal/legal/advisable?
typedef int PaStreamCallback(
const void *input, void *output,
unsigned long frameCount,
const PaStreamCallbackTimeInfo* timeInfo,
PaStreamCallbackFlags statusFlags,
void *userData );
It is fine as long as the parameter is used as PaStreamCallback* (which is a pointer to a function), like
PaError Pa_OpenStream   (
        PaStream **      stream,
        const PaStreamParameters *      inputParameters,
        const PaStreamParameters *      outputParameters,
        double      sampleRate,
        unsigned long   framesPerBuffer,
        PaStreamFlags   streamFlags,
        PaStreamCallback *      streamCallback,   // <---
        void *      userData     
    ) 
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论