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=$withval],
|
||||||
[with_portaudio=""])
|
[with_portaudio=""])
|
||||||
|
|
||||||
|
PKG_CHECK_MODULES(PORTAUDIO, portaudio-2.0 >= 19)
|
||||||
|
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
if test -n "$with_portaudio"; then
|
if test -n "$with_portaudio"; then
|
||||||
PORTAUDIO_CFLAGS="-I$withval"
|
PORTAUDIO_CFLAGS="-I$withval"
|
||||||
fi
|
fi
|
||||||
AC_SUBST(PORTAUDIO_CFLAGS)
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Check which APIs are available
|
# Check which APIs are available
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
check_PROGRAMS = px_test
|
check_PROGRAMS = px_test
|
||||||
|
|
||||||
px_test_CPPFLAGS = -I$(top_srcdir)/include
|
px_test_CPPFLAGS = -I$(top_srcdir)/include $(PORTAUDIO_CFLAGS)
|
||||||
px_test_LDADD = $(top_builddir)/src/libportmixer.la
|
px_test_LDADD = $(top_builddir)/src/libportmixer.la $(PORTAUDIO_LIBS)
|
||||||
px_test_SOURCES = px_test.c
|
px_test_SOURCES = px_test.c
|
||||||
|
@ -3,9 +3,10 @@
|
|||||||
#include "portmixer.h"
|
#include "portmixer.h"
|
||||||
#include "portaudio.h"
|
#include "portaudio.h"
|
||||||
|
|
||||||
static int DummyCallbackFunc(void *inputBuffer, void *outputBuffer,
|
static int DummyCallbackFunc(const void *input, void *output,
|
||||||
unsigned long framesPerBuffer,
|
unsigned long frameCount,
|
||||||
PaTimestamp outTime, void *userData)
|
const PaStreamCallbackTimeInfo* timeInfo,
|
||||||
|
PaStreamCallbackFlags statusFlags, void *userData)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -15,18 +16,30 @@ int main(int argc, char **argv)
|
|||||||
int num_mixers;
|
int num_mixers;
|
||||||
int i;
|
int i;
|
||||||
PaError error;
|
PaError error;
|
||||||
PortAudioStream *stream;
|
PaStream *stream;
|
||||||
|
PaStreamParameters inputParameters;
|
||||||
|
PaStreamParameters outputParameters;
|
||||||
int recDeviceNum;
|
int recDeviceNum;
|
||||||
int playDeviceNum;
|
int playDeviceNum;
|
||||||
int inputChannels = 2;
|
int inputChannels = 2;
|
||||||
|
|
||||||
recDeviceNum = Pa_GetDefaultInputDeviceID();
|
recDeviceNum = Pa_GetDefaultInputDevice();
|
||||||
playDeviceNum = Pa_GetDefaultOutputDeviceID();
|
playDeviceNum = Pa_GetDefaultOutputDevice();
|
||||||
|
|
||||||
error = Pa_OpenStream(&stream, recDeviceNum, inputChannels, paFloat32, NULL,
|
inputParameters.device = recDeviceNum;
|
||||||
paNoDevice, 0, paFloat32, NULL,
|
inputParameters.channelCount = inputChannels;
|
||||||
44101, 512, 1, paClipOff | paDitherOff,
|
inputParameters.sampleFormat = paFloat32;
|
||||||
DummyCallbackFunc, NULL);
|
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) {
|
if (error) {
|
||||||
printf("PortAudio error %d: %s\n", error,
|
printf("PortAudio error %d: %s\n", error,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user