Commit 74aece1e authored by Your Name's avatar Your Name

more zmqaudio programming

parent 050f4d8f
No preview for this file type
......@@ -180,6 +180,9 @@ int zmq_audiobuffer::fill(zmq::message_t &msg) {
if (ndata != (nsamp*nchan)) {
std::cerr <<
"in int zmq_audiobuffer::fill(zmq::message_t &msg): audio data size mismatch" <<
std::endl <<
"ndata=" << ndata << std::endl <<
"nsamp=" << nsamp << ", nchan=" << nchan << " total=" << nsamp*nchan <<
std::endl;
return 1;
}
......@@ -308,15 +311,15 @@ int main(void) {
delete[] audio_header;
//delete[] audio_data;
buffer[0] = new zmq_audiobuffer(44100, 5 * 48000, 2);
zmq_audiobuffer *data = buffer[0];
data->fill();
printf("PortAudio Test: output sine wave. SR = %d, BufSize = %d\n",
SAMPLE_RATE, data->frames_per_buffer);
//buffer[0] = new zmq_audiobuffer(44100, 5 * 48000, 2);
//zmq_audiobuffer *data = buffer[0];
//data->fill();
//printf("PortAudio Test: output sine wave. SR = %d, BufSize = %d\n",
//SAMPLE_RATE, data->frames_per_buffer);
err = data->play();
if (err != paNoError)
return print_error(err);
//err = data->play();
//if (err != paNoError)
//return print_error(err);
}
Pa_Terminate();
printf("Test finished.\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment