私はPortAudioライブラリを使用してオーディオデータを再生したいと考えています。この音声データはUDPパケットから得られます。UPD paquetsからストリームを開く方法は?
私は、ストリームをオープンする機能(かなり類似しているとPa_OpenStream())Pa_OpenDefaultStream()がありました:
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*/
私はpaquetsを再生するためにそれを使用する必要がありますが、私はないと思いますそれを使用する方法を知っている:
- 最初のパラメータは何ですか?
- なぜコールバック関数を定義する必要がありますか?任意の助けをいただければ幸いですhttp://www.portaudio.com/trac/
:)
ありがとう:ここ
はPortAudioのドキュメントへのリンクです。
「シンプルなコールバック関数」をどのように記述しますか?私はそれをコード化したいと思っています。ありがとう –