Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: remz on Wed 28/07/2021 04:30:26

Title: XM/MOD music not playing in game
Post by: remz on Wed 28/07/2021 04:30:26
Hi everyone,

Could someone confirm or please help me figure out why XM or MOD music doesn't play in my game? I try with MP3 or OGG, it works fine. But XMs or MODs don't seem to play at all. I tried from the editor, and I tried on a compiled project. I tried both in Audio.VOX or in main game data.
I tried putting a 'Display' to confirm the code was reached.

  aMyMusic.Play();
  Display("aMyMusic avail=%d type=%d", aMyMusic.IsAvailable,  aMyMusic.Type);

The display said avail=1 type=2.
In the editor, the music plays correctly when double-clicking on it and pressing the 'play' button.

I am using AGS 3.5.1.
Many thanks!
RemV
Title: Re: XM/MOD music not playing in game
Post by: Crimson Wizard on Wed 28/07/2021 05:17:18
Could you upload or link a sound file that does not play?
Title: Re: XM/MOD music not playing in game
Post by: remz on Wed 28/07/2021 14:00:09
Yes of course: https://api.modarchive.org/downloads.php?moduleid=175335#kc-basslinetech.xm
(This is one example but I tried 3 different songs and neither played.)

Thank you for your reply!
Title: Re: XM/MOD music not playing in game
Post by: Khris on Wed 28/07/2021 20:27:34
I imported the file in Audio / Music and it played fine.
Code (ags) Select
  aKc_basslinetech.Play();  // in room_Load
Title: Re: XM/MOD music not playing in game
Post by: remz on Wed 28/07/2021 22:07:35
Hmm I tried in an empty new project and it didn't work. I have modified any properties of the music either :(
Strangely the music plays correct when pressing the 'play' button in the editor so the file is OK.

[imgzoom]https://i.ibb.co/C8F72PQ/XM-not-playing.png[/imgzoom]
Title: Re: XM/MOD music not playing in game
Post by: Khris on Wed 28/07/2021 23:57:18
Here's the game I used to test it:
https://drive.google.com/file/d/1R0GP0I8SgI3u5uweT3hjjWGzcxr3zlpS/view?usp=sharing

Does that work for you? (Just run it and you should hear the track right away)
Title: Re: XM/MOD music not playing in game
Post by: remz on Thu 29/07/2021 02:41:02
Hi
Quote from: Khris on Wed 28/07/2021 23:57:18
Here's the game I used to test it:
https://drive.google.com/file/d/1R0GP0I8SgI3u5uweT3hjjWGzcxr3zlpS/view?usp=sharing

Does that work for you? (Just run it and you should hear the track right away)
Hi Khris,
Yes the music plays correctly in your packaged EXE.

I zipped my almost empty minimal test project which should play the music after the room fade-in:
https://drive.google.com/file/d/1JvkE3_wXl7DJXL-GG5g70a5F2vqNI_F7/view?usp=sharing (https://drive.google.com/file/d/1JvkE3_wXl7DJXL-GG5g70a5F2vqNI_F7/view?usp=sharing)

When I run it, it doesn't play and it displays the displaybox "Channel is null".
Would you be able to try it on your machine?
Title: Re: XM/MOD music not playing in game
Post by: Khris on Thu 29/07/2021 06:54:01
I can confirm it doesn't work with your game, I have no clue why not though.
The only differences are: you created an empty game in AGS 3.5.1 and I used the Tumbleweed template in 3.5.0. But that shouldn't make a difference.

Edit:
Apparently it does; I created a Sierra game in both 3.5.1 and 3.5.0 and it works with 3.5.0 but not with 3.5.1 (I just downloaded this (https://www.adventuregamestudio.co.uk/forums/index.php?topic=59239.0) version)
Title: Re: XM/MOD music not playing in game
Post by: remz on Thu 29/07/2021 14:12:15
Oh, thank you very much.
I am new here but I suppose there is a Bug Report section to inform the Devs about that issue on 3.5.1?
The release notes mention some fixes related to Audio, so maybe the bug was recently introduced but isn't known yet.
Title: Re: XM/MOD music not playing in game
Post by: Crimson Wizard on Thu 29/07/2021 17:24:15
I will look into this today.
Title: Re: XM/MOD music not playing in game
Post by: Crimson Wizard on Thu 29/07/2021 18:57:30
I made a fix, here's a download link to the temporary Editor build (scroll down for "Artifacts"):
https://cirrus-ci.com/task/6748614169985024

Please tell if that works for you.
Title: Re: XM/MOD music not playing in game
Post by: remz on Fri 30/07/2021 00:43:38
Quote from: Crimson Wizard on Thu 29/07/2021 18:57:30
I made a fix, here's a download link to the temporary Editor build (scroll down for "Artifacts"):
https://cirrus-ci.com/task/6748614169985024

Please tell if that works for you.

It works perfectly! 3.5.1.9 it is then! Thank you, this is the world's best customer service game engine to date :)
Title: Re: XM/MOD music not playing in game
Post by: Crimson Wizard on Fri 30/07/2021 01:43:43
I will be releasing this patch officially soon.
Title: Re: XM/MOD music not playing in game
Post by: Khris on Fri 30/07/2021 09:57:58
Quote from: remz on Fri 30/07/2021 00:43:38It works perfectly! 3.5.1.9 it is then! Thank you, this is the world's best customer service game engine to date :)
Also props to you for this being an actual bug and not pebkac :-D