Author Topic: Mainhall Muisc won't play?  (Read 2396 times)

0 Members and 1 Guest are viewing this topic.

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
Mainhall Muisc won't play?
Hey all, I'm trying to get a custom mainhall to work. I changed the music from the original to a file that's in my data/music folder, Joshua_Menu.wav:

Code: [Select]
;; GR_1024
$Main Hall

+Bitmap:                                        2_MainScreen
+Mask:                                          2_MainScreen-M
+Music: Joshua_Menu.wav

+Num Intercom Sounds: 1
+Intercom delay: 8000 15000 ;; min and max random delay for intercom sound 0
+Intercom sound: 1 ;; empty
+Intercom pan: 0.0 ;; pan for intercom sound 0


But when I load the mainhall, the music won't play. I just hear the wind rushing or rumbling or whatever that ambient effect is.

Does anyone know what's going on here? Thanks!

 

Offline m!m

  • 211
Re: Mainhall Muisc won't play?
Are you using a nightly build? If yes then try this one and check if the issue is still present. If the issue is not present then I broke something in the new audio code in which case I'll need the music file and any other required assets in order to reproduce the bug and hopefully fix it.

 

Offline Yarn

  • 210
Re: Mainhall Muisc won't play?
You can't use a file directly as your main hall's music; you have to create an entry for that file in either music.tbl or a table ending in -mus.tbm and point your main hall to that. Assuming your mod doesn't have its own music table, you can easily do this by creating a file called (for example) "joshua-mus.tbm" in your mod's data\tables folder and adding the following to the table:
Code: [Select]
#Menu Music Start

$Name:      Joshua_Menu
$Filename:  Joshua_Menu.wav

#Menu Music End

Then set your main hall's music to Joshua_Menu.
"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Mainhall Muisc won't play?
Also, you probably shouldn't use .wav files for music, but that's a separate issue.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
Re: Mainhall Muisc won't play?
You can't use a file directly as your main hall's music; you have to create an entry for that file in either music.tbl or a table ending in -mus.tbm and point your main hall to that. Assuming your mod doesn't have its own music table, you can easily do this by creating a file called (for example) "joshua-mus.tbm" in your mod's data\tables folder and adding the following to the table:
Code: [Select]
#Menu Music Start

$Name:      Joshua_Menu
$Filename:  Joshua_Menu.wav

#Menu Music End

Then set your main hall's music to Joshua_Menu.

Oh, that makes sense, thanks!

Also, you probably shouldn't use .wav files for music, but that's a separate issue.

Um, why is this? Are .ogg files better?

Are you using a nightly build? If yes then try this one and check if the issue is still present. If the issue is not present then I broke something in the new audio code in which case I'll need the music file and any other required assets in order to reproduce the bug and hopefully fix it.

No, I'm using 3.7.4 No SSE Debug official build. Thanks for the help anyway. :)

 
Re: Mainhall Muisc won't play?
Um, why is this? Are .ogg files better?

In pretty much every concievable way. In my experience, .ogg have much better sound quality while being significantly smaller.

.wav files should have died with the 1990s.

 

Offline Mongoose

  • Rikki-Tikki-Tavi
  • Global Moderator
  • 212
  • This brain for rent.
    • Minecraft
    • Steam
    • Something
Re: Mainhall Muisc won't play?
Um, not quite.  Given the same source audio, there's no possible way that an .ogg file can have better quality than a .wav, as the latter represents the raw uncompressed audio data, whereas the former is a lossy compressed format.  (Well technically there's a way to compress .wavs too, but let's ignore that for the moment.)  Your source files should always be kept as .wavs, or at least as a lossless compressed format like .flac.  That being said, .wav files are big, and they should definitely not be distributed in a mod's released form so as to save on space.  You'll want to encode everything as .ogg before you ship things out.

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Mainhall Muisc won't play?
Generally, a .wav file that doesn't sound like crap will take up way more space than an .ogg file that will sound indistinguishable to the audience. Most people would rather not have individual music files take up dozens of megabytes (takes longer to download, if nothing else).
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: Mainhall Muisc won't play?
Middle ground would be FLAC, if FSO supports it (lossless audio with decent compression).

The wiki seems to indicate it does (but the container must be .ogg, so instead of OGG Vorbis, it would be OGG FLAC, see here:
Quote
What is the difference between (native) FLAC and Ogg FLAC?

You can think of an audio codec as having two layers. The inside layer is the raw compressed data, and the outside layer is the "container" or "transport layer" that splits and arranges the compressed data in pieces so it can be seeked through, edited, etc.

"Native" FLAC is the compressed FLAC data stored in a very minimalist container, designed to be very efficient at storing single audio streams.

Ogg FLAC is the compressed FLAC data stored in an Ogg container. Ogg is a much more powerful transport layer that enables mixing several kinds of different streams (audio, data, metadata, etc). The overhead is slightly higher than with native FLAC.

In either case, the compressed FLAC data is the same and one can be converted to the other without re-encoding.

Which should I use, (native) FLAC or Ogg FLAC?

The short answer right now is probably "native FLAC". If all you are doing is compressing audio to be played back later, native FLAC will do everything you need, is more widely supported, and will yield smaller files. If you plan to edit the compressed audio, or want to multiplex the audio with video later in an Ogg container, Ogg FLAC is a better choice.

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Mainhall Muisc won't play?
Given we now handle audio through ffmpeg, we could probably be made to support .flac by just adding it to the list of valid audio file extensions; still, even FLAC is massive overkill from a disk space standpoint (there is absolutely no reason for end users to need lossless audio files).
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Mainhall Muisc won't play?
There could be a case for encouraging content creators to share their source files; even so I don't see that as being a big issue for audio (more an issue for textures & similar images)
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline HLD_Prophecy

  • PVD_Hope in a former life
  • 29
Re: Mainhall Muisc won't play?
So what you guys are saying is that I really should go back and convert all my .wav files (and adjust the play-sound-from-file symbolic expressions accordingly) before release?