Author Topic: BASS_MusicLoad returns error code 41 on macOS  (Read 290 times)


  • Posts: 14
I am trying to load an XM file from memory and wanted to play it. For that I have converted a XM file into hex array. Everything is working very fine and playing music under Windows system, but I am getting error code 41 (Unsupported file format) when trying to load music from memory using "BASS_MusicLoad" under macOS.

Below is the code:
Code: [Select]
#include <stdio.h>
#include "bass.h"
#include "hwk.h"

int main(int argc, const char * argv[]) {
    printf("Loading bass module...\n");
    int init = BASS_Init(-1, 44100, BASS_DEVICE_DEFAULT, NULL, NULL);
        printf("Bass module loaded successfully\n");
        int music = BASS_MusicLoad(TRUE, table, 0, sizeof(table), BASS_SAMPLE_LOOP, 0);
            printf("Music loaded successfully\n");
            BASS_ChannelPlay(music, FALSE);
            printf("Unable to load music into memory\n");
            printf("Error: %d\n", BASS_ErrorGetCode());
        printf("Unable to load bass module, exiting...\n");
    return 0;

The converted XM to hex array (included in hwk.h header file):

Can anyone help me out?

Ian @ un4seen

  • Administrator
  • Posts: 21211
Re: BASS_MusicLoad returns error code 41 on macOS
« Reply #1 on: 10 Jul '17 - 17:09 »
Are you sure the exact same code and "table" data is working on Windows? I think the "table" array's type should be "unsigned char" rather than "unsigned long".


  • Posts: 14
Re: BASS_MusicLoad returns error code 41 on macOS
« Reply #2 on: 10 Jul '17 - 17:15 »
How stupid I am  ???

Thanks for your help.