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
208bfdc1
Commit
208bfdc1
authored
Sep 04, 2020
by
Your Name
Browse files
fix C++ comments
parent
ce605efb
Changes
1
Hide whitespace changes
Inline
Side-by-side
lsldert/zmqaudio.cc
View file @
208bfdc1
...
...
@@ -88,10 +88,10 @@ zmq_audiobuffer::~zmq_audiobuffer() {
Pa_CloseStream
(
stream
);
}
/
*
This routine will be called by the PortAudio engine when audio is needed.
**
It may called at interrupt level on some machines so don't do anything
**
that could mess up the system like calling malloc() or free().
*
/
/
/
This routine will be called by the PortAudio engine when audio is needed.
//
It may called at interrupt level on some machines so don't do anything
//
that could mess up the system like calling malloc() or free().
/
/
int
zmq_audiobuffer
::
stream_callback
(
const
void
*
,
void
*
outputBuffer
,
unsigned
long
framesPerBuffer
,
...
...
@@ -118,9 +118,9 @@ int zmq_audiobuffer::stream_callback(
return
ret
;
}
/
*
*
This routine is called by portaudio when playback is done.
*
/
/
/
//
This routine is called by portaudio when playback is done.
/
/
void
zmq_audiobuffer
::
stream_finished
(
void
*
userData
)
{
zmq_audiobuffer
*
pbuf
=
(
zmq_audiobuffer
*
)
userData
;
pbuf
->
playing
=
false
;
...
...
@@ -133,23 +133,23 @@ int zmq_audiobuffer::play() {
PaStreamParameters
outputParameters
;
outputParameters
.
device
=
Pa_GetDefaultOutputDevice
();
/
*
default output device
*/
Pa_GetDefaultOutputDevice
();
/
/
default output device
if
(
outputParameters
.
device
==
paNoDevice
)
{
fprintf
(
stderr
,
"Error: No default output device.
\n
"
);
return
paNoDevice
;
}
outputParameters
.
channelCount
=
nchan
;
/
*
stereo output
*/
outputParameters
.
channelCount
=
nchan
;
/
/
stereo output
outputParameters
.
sampleFormat
=
paFloat32
;
/
*
32 bit floating point output
*/
paFloat32
;
/
/
32 bit floating point output
outputParameters
.
suggestedLatency
=
Pa_GetDeviceInfo
(
outputParameters
.
device
)
->
defaultLowOutputLatency
;
outputParameters
.
hostApiSpecificStreamInfo
=
NULL
;
PaError
err
;
err
=
Pa_OpenStream
(
&
stream
,
NULL
,
/
*
no input
*/
err
=
Pa_OpenStream
(
&
stream
,
NULL
,
/
/
no input
&
outputParameters
,
fsamp
,
frames_per_buffer
,
paClipOff
,
/
*
we won't output out of range samples so
don't bother clipping them
*/
paClipOff
,
/
/
we won't output out of range samples so
//
don't bother clipping them
zmq_audiobuffer
::
stream_callback
,
this
);
sprintf
(
message
,
"No Message"
);
err
=
...
...
@@ -246,7 +246,6 @@ int zmq_recv_multi(zmq::socket_t &socket, zmq::message_t parts[], int nmax) {
return
n
;
}
/*******************************************************************/
int
main
(
void
)
{
PaError
err
=
Pa_Initialize
();
...
...
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