PortAudio ライブラリを使用して音声データを再生したいと考えています。この音声データは、UDP パケットから取得されます。
ストリームを開くための Pa_OpenDefaultStream() (およびかなり似ている Pa_OpenStream()) 関数があることを確認しました。
PaStream *stream;
PaError err;
/* Open an audio I/O stream. */
err = Pa_OpenDefaultStream( &stream,
0, /* no input channels */
2, /* stereo output */
paFloat32, /* 32 bit floating point output */
SAMPLE_RATE,
256, /* frames per buffer, i.e. the number
of sample frames that PortAudio will
request from the callback. Many apps
may want to use
paFramesPerBufferUnspecified, which
tells PortAudio to pick the best,
possibly changing, buffer size.*/
patestCallback, /* this is your callback function */
&data ); /*This is a pointer that will be passed to
your callback*/
パケを演奏するためにそれを使用する必要があると思いますが、使用方法がわかりません :
- 最初のパラメータは何ですか?
- コールバック関数を定義する必要があるのはなぜですか?
PortAudio ドキュメントへのリンクは次のとおりです。 http://www.portaudio.com/trac/
どんな助けでも大歓迎です:)
ありがとう。