In-game music

Allegiance discussion not belonging in another forum.
aem
Posts: 1471
Joined: Sat Apr 02, 2005 8:00 am
Location: Charlotte, NC

Post by aem »

Imago wrote:QUOTE (Imago @ Feb 2 2014, 10:13 PM) nope, nothing has changed to break it. just make sure your allegiance CD is in the drive.
I just tested it and it is broken. Though keep in mind we are trying to play .wav's in the artwork folder and not off a CD. Log shows some errors.

Failed to find CD line on mixer 3
Failed to find CD line on mixer 4
Open failed for CD Audio device '': The specified file cannot be played on the specified MCI device. The file may be corrupt, not in the correct format, or no file handler available for this format.
Directsound driver is not certified by Microsoft and is not emulated.
The primary buffer can be 8 bit 16 bit mono stereo.
The secondary buffers can range continuously from 100 Hz to 200000 Hz, and can be 8 bit 16 bit mono stereo.
There is hardware support for mixing 1 buffers, including 1 static and 1 streaming buffers.
There is hardware support for 0 3D buffers, including 0 static 3D and 0 streaming 3D buffers.
Time reading sounds: 919 ms
Time initializing sound: 1201 ms

Tested with R5 Allegiance.exe and works fine. Some R6 update appears to have broken support for the built in music player.
Last edited by aem on Mon Feb 03, 2014 7:18 pm, edited 1 time in total.
French_Touch
Posts: 154
Joined: Mon Nov 16, 2009 7:56 pm
Location: France -> BC, Canada

Post by French_Touch »

Thanks for your feedback. I think I will have to use another player... too bad!
aem
Posts: 1471
Joined: Sat Apr 02, 2005 8:00 am
Location: Charlotte, NC

Post by aem »

French_Touch wrote:QUOTE (French_Touch @ Feb 3 2014, 05:34 PM) Thanks for your feedback. I think I will have to use another player... too bad!
For now it appears that way. I am going to try to track down what change broke this though as this is a feature I really like.
aem
Posts: 1471
Joined: Sat Apr 02, 2005 8:00 am
Location: Charlotte, NC

Post by aem »

OK I tracked down the error. You can get this to work (see bottom of post), but Allegiance is currently not looking in the correct place for wav files. pkk broke it a long time ago and apparently no one ever noticed? The in-game music through musicdef.mdl is a feature I really like. No one else puts their own music into the game?

http://trac.alleg.net/changeset/600/allegsvn is the update that introduced the issue.

While removing SoundPack support, pkk mistakenly set Allegiance to look in the folder above the artwork directory for wav files.

ZString strFilename = m_pmodeler->GetArtPath() + "\\..\\" + pstring->GetValue() + ".wav";

should be..

ZString strFilename = m_pmodeler->GetArtPath() + "\\" + pstring->GetValue() + ".wav";

Workaround:
You can either put the wav files in the same folder as Allegiance.exe (Production and/or Beta Folders) OR this does in fact support ogg files which look in the correct directory (Production/Artwork or Beta/Artwork).

So move the wav files or use ogg files and you should hear your music :thumbsup:

If using WAV files I'd keep a copy of them in the Artwork folder as well as I am going to see about getting the code fixed and hopefully into the Beta soon and Production whenever next update is pushed out.
Last edited by aem on Tue Feb 04, 2014 4:41 pm, edited 1 time in total.
French_Touch
Posts: 154
Joined: Mon Nov 16, 2009 7:56 pm
Location: France -> BC, Canada

Post by French_Touch »

I'll try this, thank you for putting efforts into it!
Post Reply