Author Topic: XM File looped playback issue  (Read 212 times)

Baru

  • Posts: 4
XM File looped playback issue
« on: 20 Oct '22 - 17:07 »
Hello Everyone,
I'm using bass.dll in my game project because I'm using *.xm music files. First version of game was written 20 years ago in C++, and it was also using bass. Now I managed to rewrite playback 'engine' using bass.net wrapper. Everything seems to work fine except short music which is played in loop in game menu. Very last sound(note) of music is somehow prolonged giving audible strange effect ('Not proper.mp3' in attachment). Same file played in xmplay application works fine ('Proper.mp3' in attachment). Can't find the reason. I also used code from Bass24.Net\Samples\CS\MyFirstBass to play my music with same 'Not proper' result. Maybe i'm missing some flag in BASS_Init or in BASS_MusicLoad or frequency is not properly set? Do you have any suggestions what should I try? Below is part of code i use for playback:
Code: [Select]
            // init BASS using the default output device
            if ( Bass.BASS_Init(-1, 44100,
                BASSInit.BASS_DEVICE_DEFAULT
                , IntPtr.Zero) )
            {
                // create a stream channel from a file
                int stream = Bass.BASS_MusicLoad("menu.xm", 0, 0,
                    BASSFlag.BASS_MUSIC_LOOP | BASSFlag.BASS_MUSIC_RAMPS,
                    0);
                if (stream != 0)
                {
                    // play the channel
                    Bass.BASS_ChannelPlay(stream, false);
                }
Thanks in advance for help
« Last Edit: 20 Oct '22 - 17:29 by Baru »

Ian @ un4seen

  • Administrator
  • Posts: 24802
Re: XM File looped playback issue
« Reply #1 on: 21 Oct '22 - 17:01 »
Playback of that XM file seems to be pretty much identical here with the current versions of BASS and XMPlay. If they're different there then perhaps you're using an old BASS version? Please check that with BASS_GetVersion, and if it is indeed an old version then try upgrading to 2.4.17 and see if that helps.

Baru

  • Posts: 4
Re: XM File looped playback issue
« Reply #2 on: 21 Oct '22 - 17:14 »
Hello,
Get Version returns 0x02041007 so I believe it is the one you mentioned.

Baru

  • Posts: 4
Re: XM File looped playback issue
« Reply #3 on: 21 Oct '22 - 17:18 »
It a bit sounds like some kind of reverb added to original sound. I don't know but maybe bass enables such or similar feature by default ?

Ian @ un4seen

  • Administrator
  • Posts: 24802
Re: XM File looped playback issue
« Reply #4 on: 21 Oct '22 - 17:30 »
0x02041007 is 2.4.16.7, so it's the previous BASS release. Please try replacing it with the latest and see if that helps. BASS_GetVersion should return 0x02041100 then. If it still doesn't sound right, also confirm what XMPlay version it is that is sounding right.

Baru

  • Posts: 4
Re: XM File looped playback issue
« Reply #5 on: 21 Oct '22 - 23:02 »
I've downloaded newest bass.dll version (it has version number 0x02041100) and it worked like a charm :) I have another problem which I want to solve, but first I will search forum for an answer and maybe be back with another thread.

Thank you very much for help