mirror of
https://github.com/cookiengineer/audacity
synced 2025-04-30 15:49:41 +02:00
Update portmixer test from portaudio v18 to v19 and fix the compilation.
This commit is contained in:
parent
c2a15f6df6
commit
b947c07ad8
@ -44,13 +44,14 @@ AC_ARG_WITH([pa-include],
|
||||
[with_portaudio=$withval],
|
||||
[with_portaudio=""])
|
||||
|
||||
PKG_CHECK_MODULES(PORTAUDIO, portaudio-2.0 >= 19)
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
if test -n "$with_portaudio"; then
|
||||
PORTAUDIO_CFLAGS="-I$withval"
|
||||
fi
|
||||
AC_SUBST(PORTAUDIO_CFLAGS)
|
||||
|
||||
#
|
||||
# Check which APIs are available
|
||||
|
@ -1,5 +1,5 @@
|
||||
check_PROGRAMS = px_test
|
||||
|
||||
px_test_CPPFLAGS = -I$(top_srcdir)/include
|
||||
px_test_LDADD = $(top_builddir)/src/libportmixer.la
|
||||
px_test_CPPFLAGS = -I$(top_srcdir)/include $(PORTAUDIO_CFLAGS)
|
||||
px_test_LDADD = $(top_builddir)/src/libportmixer.la $(PORTAUDIO_LIBS)
|
||||
px_test_SOURCES = px_test.c
|
||||
|
@ -3,9 +3,10 @@
|
||||
#include "portmixer.h"
|
||||
#include "portaudio.h"
|
||||
|
||||
static int DummyCallbackFunc(void *inputBuffer, void *outputBuffer,
|
||||
unsigned long framesPerBuffer,
|
||||
PaTimestamp outTime, void *userData)
|
||||
static int DummyCallbackFunc(const void *input, void *output,
|
||||
unsigned long frameCount,
|
||||
const PaStreamCallbackTimeInfo* timeInfo,
|
||||
PaStreamCallbackFlags statusFlags, void *userData)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -14,19 +15,31 @@ int main(int argc, char **argv)
|
||||
{
|
||||
int num_mixers;
|
||||
int i;
|
||||
PaError error;
|
||||
PortAudioStream *stream;
|
||||
int recDeviceNum;
|
||||
int playDeviceNum;
|
||||
int inputChannels = 2;
|
||||
PaError error;
|
||||
PaStream *stream;
|
||||
PaStreamParameters inputParameters;
|
||||
PaStreamParameters outputParameters;
|
||||
int recDeviceNum;
|
||||
int playDeviceNum;
|
||||
int inputChannels = 2;
|
||||
|
||||
recDeviceNum = Pa_GetDefaultInputDeviceID();
|
||||
playDeviceNum = Pa_GetDefaultOutputDeviceID();
|
||||
recDeviceNum = Pa_GetDefaultInputDevice();
|
||||
playDeviceNum = Pa_GetDefaultOutputDevice();
|
||||
|
||||
error = Pa_OpenStream(&stream, recDeviceNum, inputChannels, paFloat32, NULL,
|
||||
paNoDevice, 0, paFloat32, NULL,
|
||||
44101, 512, 1, paClipOff | paDitherOff,
|
||||
DummyCallbackFunc, NULL);
|
||||
inputParameters.device = recDeviceNum;
|
||||
inputParameters.channelCount = inputChannels;
|
||||
inputParameters.sampleFormat = paFloat32;
|
||||
inputParameters.suggestedLatency = 0;
|
||||
inputParameters.hostApiSpecificStreamInfo = NULL;
|
||||
|
||||
outputParameters.device = paNoDevice;
|
||||
outputParameters.channelCount = 0;
|
||||
outputParameters.sampleFormat = paFloat32;
|
||||
outputParameters.suggestedLatency = 0;
|
||||
outputParameters.hostApiSpecificStreamInfo = NULL;
|
||||
|
||||
error = Pa_OpenStream(&stream, &inputParameters, &outputParameters, 44101,
|
||||
512, paClipOff | paDitherOff, DummyCallbackFunc, NULL);
|
||||
|
||||
if (error) {
|
||||
printf("PortAudio error %d: %s\n", error,
|
||||
|
Loading…
x
Reference in New Issue
Block a user