aboutsummaryrefslogtreecommitdiff
path: root/pd/portaudio/pa_tests/patest_ringmix.c
diff options
context:
space:
mode:
authorGuenter Geiger <ggeiger@users.sourceforge.net>2004-02-02 12:18:59 +0000
committerGuenter Geiger <ggeiger@users.sourceforge.net>2004-02-02 12:18:59 +0000
commit2e416ee0095f1bf608f849f156d564e0f45fb8ab (patch)
tree9e4881e81953b434b91dbd35218d78f05b27e82e /pd/portaudio/pa_tests/patest_ringmix.c
parentae6b5d89ea93b95c2990895077cf5e8f0bba9ad9 (diff)
merged in version_0_37_1test6
svn path=/trunk/; revision=1305
Diffstat (limited to 'pd/portaudio/pa_tests/patest_ringmix.c')
-rw-r--r--pd/portaudio/pa_tests/patest_ringmix.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/pd/portaudio/pa_tests/patest_ringmix.c b/pd/portaudio/pa_tests/patest_ringmix.c
deleted file mode 100644
index 34c66381..00000000
--- a/pd/portaudio/pa_tests/patest_ringmix.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* $Id: patest_ringmix.c,v 1.1.1.1 2003-05-09 16:03:56 ggeiger Exp $ */
-
-#include "stdio.h"
-#include "portaudio.h"
-/* This will be called asynchronously by the PortAudio engine. */
-static int myCallback( void *inputBuffer, void *outputBuffer,
- unsigned long framesPerBuffer, PaTimestamp outTime, void *userData )
-{
- float *out = (float *) outputBuffer;
- float *in = (float *) inputBuffer;
- float leftInput, rightInput;
- unsigned int i;
- if( inputBuffer == NULL ) return 0;
- /* Read input buffer, process data, and fill output buffer. */
- for( i=0; i<framesPerBuffer; i++ )
- {
- leftInput = *in++; /* Get interleaved samples from input buffer. */
- rightInput = *in++;
- *out++ = leftInput * rightInput; /* ring modulation */
- *out++ = 0.5f * (leftInput + rightInput); /* mix */
- }
- return 0;
-}
-/* Open a PortAudioStream to input and output audio data. */
-int main(void)
-{
- PortAudioStream *stream;
- Pa_Initialize();
- Pa_OpenDefaultStream(
- &stream,
- 2, 2, /* stereo input and output */
- paFloat32, 44100.0,
- 64, 0, /* 64 frames per buffer, let PA determine numBuffers */
- myCallback, NULL );
- Pa_StartStream( stream );
- Pa_Sleep( 10000 ); /* Sleep for 10 seconds while processing. */
- Pa_StopStream( stream );
- Pa_CloseStream( stream );
- Pa_Terminate();
- return 0;
-}