Hi Jobnik,
Either I'm overlooking something obvious, or I've run into what seems to be a bug in the 64-bit version of bass_fx 2.4.11 on Linux (Ubuntu 14.04). The following code works as expected when compiled against the 32-bit version of the library, but produces a segmentation fault in BASS_FX_TempoCreate() when compiled against the 64-bit version of the library.
#include <stdlib.h>
#include <stdio.h>
#include "bass.h"
#include "bass_fx.h"
int main()
{
int result = BASS_Init(-1, 44100, 0, 0, 0);
if (result == 0)
{
printf("BASS_Init() failed: %i\n", BASS_ErrorGetCode());
return 1;
}
DWORD stream = BASS_StreamCreateFile(FALSE, "Example.ogg", 0, 0, BASS_SAMPLE_LOOP | BASS_STREAM_DECODE);
if (stream == 0)
{
printf("BASS_StreamCreateFile() failed: %i\n", BASS_ErrorGetCode());
return 1;
}
stream = BASS_FX_TempoCreate(stream, BASS_FX_FREESOURCE);
if (stream == 0)
{
printf("BASS_FX_TempoCreate() failed: %i\n", BASS_ErrorGetCode());
return 1;
}
if (!BASS_ChannelSetAttribute(stream, BASS_ATTRIB_TEMPO_PITCH, -12.0f))
{
printf("BASS_ChannelSetAttribute() failed: %i\n", BASS_ErrorGetCode());
return 1;
}
if (!BASS_ChannelPlay(stream, FALSE))
{
printf("BASS_ChannelPlay() failed: %i\n", BASS_ErrorGetCode());
return 1;
}
printf("Playing stream, press any key...\n");
getchar();
return 0;
}
Thanks for all the time you've put into this library!