Skip to content

Instantly share code, notes, and snippets.

View alitokur's full-sized avatar
🦊

badcode alitokur

🦊
View GitHub Profile
@alitokur
alitokur / portAudioRecorder.cpp
Created April 21, 2021 22:58
creating 1 second raw auido packets with portauido
#include <iostream>
#include "portaudio.h"
#include <string>
#include <string.h>
#include <algorithm> // std::copy
/* #define SAMPLE_RATE (17932) // Test failure to open with this value. */
#define SAMPLE_RATE (48000)
#define FRAMES_PER_BUFFER (512)
#define NUM_SECONDS (10)
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <iostream>
int
main(int argc, char *argv[])
{
PyObject *pName, *pModule, *pFunc;
PyObject *pArgs, *pValue;