Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Scoville on Tue 08/06/2004 07:06:51

Title: No music.vox file created
Post by: Scoville on Tue 08/06/2004 07:06:51
I've put a few music files into my game, but they won't play. The files are all labeled "musicx.wav" (I have also tried "Musicx.wav" and "MUSICx.wav" but those didn't work either). They are all located in the ags/game/ directory. The problem seems to be that no .vox file is created when I tell AGS to do so. No such file is in the compiled directory, and if I put a script in to check if a music.vox file is found, the game says it is not.

Whenever I add a new music file, AGS asks if I want to recreate the VOX file, I say yes, but still no file is made. If I hit recompile VOX files, still nothing happens. I am using the play music on room entry check box to play the music. Any suggestions?
Title: Re: No music.vox file created
Post by: LordHart on Tue 08/06/2004 07:28:22
Are the wav files named... musicx.wav or have you named them properly with names like music1.wav?

The X is where you should put the number. Then you must have either PlaySound(X); or PlayMusic(X); where you want the sound or music to play...

After you have done that, then you must select the Make VOX file or update Vox files or whatever it says from the menu.
Title: Re: No music.vox file created
Post by: strazer on Tue 08/06/2004 13:17:28
You can't use WAV files for music:

PlayMusic (int music_number)

Changes the currently playing background music to MUSICx.OGG, MUSICx.MP3, MUSICx.MID, MUSICx.MOD or MUSICx.XM (where X is MUSIC_NUMBER).
Title: Re: No music.vox file created
Post by: Scorpiorus on Tue 08/06/2004 15:00:09
The manual, however, states that it is possible to have a WAV as a music file. Although I never tried to include a wav music file before I always thought it was possible. But seems like, yes, it doesn't even build a music.vox file. So, this is either a bug or some sort of inconsistency in the manual.
Title: Re: No music.vox file created
Post by: Mr Flibble on Tue 08/06/2004 20:04:01
Couldn't you just rename your songs Soundx.wav, and tell AGS to play that sound?
Title: Re: No music.vox file created
Post by: Scoville on Wed 09/06/2004 05:59:47
Thanks. I did have the files named music1.wav, music2, and so on.  Playing the music as a sound effect wouldn't work, though, because the music wouldn't loop that way.

It's no big deal that wavs don't work. I was planning on converting to OGG eventually, I just don't have the program for it yet, and wanted to test the music before bother with downloading it and compressing the files.
Title: Re: No music.vox file created
Post by: Barbarian on Wed 09/06/2004 06:34:54
Actually, you could play a sound effect as a loop, end effectively having it play as your music for a room.

Use the PlayAmbientSound (int channel, int sound, int volume, int x, int y); command.

An example (from the help manual) is:
"  PlayAmbientSound (1, 10, 150, 250, 110);

starts SOUND10.MP3 (or in your case, SOUND10.WAV) playing in the background, at a medium volume (volume can be set from 1 to 255, 255 being the loudest) and coming from co-ordinates (250, 110). "

If you want the sound to play equally from any position in the room, you'd set "X" and Y" as "0", so it would look like:

" PlayAmbientSound (1, 10, 150, 0, 0); "

Look up the PlayAmbientSound command for more details  ;)

A couple of other things to note though (quoted from the help manual again):

"NOTE: The sound will stop when the player leaves the room.

NOTE: In order to optimise the looping of the sound, the entire sound effect is loaded into memory. Therefore, do not use this function to play normal background music with, since music files tend to be very large and are better streamed from disk with the normal music functions."

Title: Re: No music.vox file created
Post by: Ishmael on Wed 09/06/2004 08:41:06
If I recall right, you could use PlaySound(1001); to play music1.wav ..?
Title: Re: No music.vox file created
Post by: Scorpiorus on Wed 09/06/2004 09:35:05
Yeah, this is one of the things I tried at first but then eventually realized that AGS doesn't build a music.vox file (since the manual says it should do) nor attachs them to game .EXE.
Obviously, that's not really practical to distibute the final release with the WAV-ed music but could come in handy while we are in mid-design, as Scoville mentioned.
Title: Re: No music.vox file created
Post by: Mr Flibble on Thu 10/06/2004 00:04:10
Just a thought, open windows media player. Click on "file", then "open". Select one of your .wav files. "Save As" (filename).mp3

Solved.
Basically, you can open a file in Windows Media Player and save it to almost any other format. If you have WMP.
Not technically an AGS solution, but what the hey.