projects
/
rtaudio-cdist.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Minor update to release.txt
[rtaudio-cdist.git]
/
tests
/
record.cpp
diff --git
a/tests/record.cpp
b/tests/record.cpp
index 7fb1317ac7922e088c0970a681b3dabd0ad84ee2..4bd9d30f304a495d5dfedd2019f0e7dd0a80e376 100644
(file)
--- a/
tests/record.cpp
+++ b/
tests/record.cpp
@@
-11,26
+11,29
@@
#include "RtAudio.h"
#include <iostream>
#include "RtAudio.h"
#include <iostream>
+#include <cstdlib>
+#include <cstring>
+#include <stdio.h>
/*
/*
-typedef char
MY_TYPE;
+typedef char MY_TYPE;
#define FORMAT RTAUDIO_SINT8
#define FORMAT RTAUDIO_SINT8
+*/
-typedef signed short
MY_TYPE;
+typedef signed short MY_TYPE;
#define FORMAT RTAUDIO_SINT16
#define FORMAT RTAUDIO_SINT16
-typedef signed long MY_TYPE;
+/*
+typedef S24 MY_TYPE;
#define FORMAT RTAUDIO_SINT24
#define FORMAT RTAUDIO_SINT24
-typedef signed long
MY_TYPE;
+typedef signed long MY_TYPE;
#define FORMAT RTAUDIO_SINT32
#define FORMAT RTAUDIO_SINT32
-*/
-typedef float
MY_TYPE;
+typedef float MY_TYPE;
#define FORMAT RTAUDIO_FLOAT32
#define FORMAT RTAUDIO_FLOAT32
-/*
-typedef double MY_TYPE;
+typedef double MY_TYPE;
#define FORMAT RTAUDIO_FLOAT64
*/
#define FORMAT RTAUDIO_FLOAT64
*/
@@
-123,7
+126,7
@@
int main( int argc, char *argv[] )
try {
adc.openStream( NULL, &iParams, FORMAT, fs, &bufferFrames, &input, (void *)&data );
}
try {
adc.openStream( NULL, &iParams, FORMAT, fs, &bufferFrames, &input, (void *)&data );
}
- catch ( RtError& e ) {
+ catch ( Rt
Audio
Error& e ) {
std::cout << '\n' << e.getMessage() << '\n' << std::endl;
goto cleanup;
}
std::cout << '\n' << e.getMessage() << '\n' << std::endl;
goto cleanup;
}
@@
-145,15
+148,14
@@
int main( int argc, char *argv[] )
try {
adc.startStream();
}
try {
adc.startStream();
}
- catch ( RtError& e ) {
+ catch ( Rt
Audio
Error& e ) {
std::cout << '\n' << e.getMessage() << '\n' << std::endl;
goto cleanup;
}
std::cout << "\nRecording for " << time << " seconds ... writing file 'record.raw' (buffer frames = " << bufferFrames << ")." << std::endl;
std::cout << '\n' << e.getMessage() << '\n' << std::endl;
goto cleanup;
}
std::cout << "\nRecording for " << time << " seconds ... writing file 'record.raw' (buffer frames = " << bufferFrames << ")." << std::endl;
- while (
1
) {
+ while (
adc.isStreamRunning()
) {
SLEEP( 100 ); // wake every 100 ms to check if we're done
SLEEP( 100 ); // wake every 100 ms to check if we're done
- if ( adc.isStreamRunning() == false ) break;
}
// Now write the entire data to the file.
}
// Now write the entire data to the file.