summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/portaudio/examples/paex_record_file.c
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/portaudio/examples/paex_record_file.c')
-rw-r--r--3rdparty/portaudio/examples/paex_record_file.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/3rdparty/portaudio/examples/paex_record_file.c b/3rdparty/portaudio/examples/paex_record_file.c
index 1f1211fce98..f1276ecbed4 100644
--- a/3rdparty/portaudio/examples/paex_record_file.c
+++ b/3rdparty/portaudio/examples/paex_record_file.c
@@ -1,7 +1,7 @@
/** @file paex_record_file.c
- @ingroup examples_src
- @brief Record input into a file, then playback recorded data from file (Windows only at the moment)
- @author Robert Bielik
+ @ingroup examples_src
+ @brief Record input into a file, then playback recorded data from file (Windows only at the moment)
+ @author Robert Bielik
*/
/*
* $Id: paex_record_file.c 1752 2011-09-08 03:21:55Z philburk $
@@ -31,13 +31,13 @@
*/
/*
- * The text above constitutes the entire PortAudio license; however,
+ * The text above constitutes the entire PortAudio license; however,
* the PortAudio community also makes the following non-binding requests:
*
* Any person wishing to distribute modifications to the Software is
* requested to send the modifications to the original developer so that
- * they can be incorporated into the canonical version. It is also
- * requested that these non-binding requests be included along with the
+ * they can be incorporated into the canonical version. It is also
+ * requested that these non-binding requests be included along with the
* license above.
*/
@@ -315,7 +315,7 @@ int main(void)
/* We set the ring buffer size to about 500 ms */
numSamples = NextPowerOf2((unsigned)(SAMPLE_RATE * 0.5 * NUM_CHANNELS));
numBytes = numSamples * sizeof(SAMPLE);
- data.ringBufferData = (SAMPLE *) PaUtil_AllocateMemory( numBytes );
+ data.ringBufferData = (SAMPLE *) PaUtil_AllocateZeroInitializedMemory( numBytes );
if( data.ringBufferData == NULL )
{
printf("Could not allocate ring buffer data.\n");
@@ -433,12 +433,12 @@ int main(void)
}
if( err < 0 ) goto done;
}
-
+
err = Pa_CloseStream( stream );
if( err != paNoError ) goto done;
fclose(data.file);
-
+
printf("Done.\n"); fflush(stdout);
}
@@ -448,11 +448,10 @@ done:
PaUtil_FreeMemory( data.ringBufferData );
if( err != paNoError )
{
- fprintf( stderr, "An error occured while using the portaudio stream\n" );
+ fprintf( stderr, "An error occurred while using the portaudio stream\n" );
fprintf( stderr, "Error number: %d\n", err );
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
err = 1; /* Always return 0 or 1, but no other return codes. */
}
return err;
}
-