Skip to content

Instantly share code, notes, and snippets.

@GRGSIBERIA
Created December 12, 2016 05:44
Show Gist options
  • Save GRGSIBERIA/568ecd9e242455f1ac9b76c44b7642d2 to your computer and use it in GitHub Desktop.
Save GRGSIBERIA/568ecd9e242455f1ac9b76c44b7642d2 to your computer and use it in GitHub Desktop.
PortAudioの一部を抜粋
struct PaTestData {
int frameIndex;
int maxFrameIndex;
SAMPLE *recordedSamples;
};
int main() {
PaTestData data;
PaStreamParameters inputParameters, outputParameters;
PaStream *stream;
data.maxFrameIndex = totalFrames;
// 以下,2行に渡りdataを初期化
err = Pa_Initialize();
inputParameters.device = Pa_GetDefaultInputDevice();
// 以下,4行に渡りinputParametersを初期化
outputParameters.device = Pa_GetDefaultOutputDevice();
// 以下,4行に渡りoutputParametersを初期化
err = Pa_OpenStream(/* 8個の引数 */);
err = Pa_StartStream(stream);
while ((err = Pa_IsStreamActive(stream)) == 1)
Pa_Sleep(1000); // ストリーミング
err = Pa_CloseStream(stream);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment