Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Biophysics Labs
Firmware
Commits
74aece1e
Commit
74aece1e
authored
Aug 05, 2020
by
Your Name
Browse files
more zmqaudio programming
parent
050f4d8f
Changes
2
Hide whitespace changes
Inline
Side-by-side
lsldert/zmqaudio
View file @
74aece1e
No preview for this file type
lsldert/zmqaudio.cc
View file @
74aece1e
...
...
@@ -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
"
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment