Well, the music is saved under a .wav file. For some reason, it wouldn't play it as music, so I made it a sound effect instead. But now, how do I stop the music from playing when you leave the room?
.wav isn't an accepted format for Music (see the PlayMusic(..) (http://www.adventuregamestudio.co.uk/manual/PlayMusic.htm) entry in the manual). You could convert it to .ogg or .mp3, and then you'll be able to play it as Music, and stop it with StopMusic().
For Sounds, you could try playing it through a specific channel with PlaySoundEx(..) (http://www.adventuregamestudio.co.uk/manual/PlaySoundEx.htm), then stoping it with StopChannel(..) (http://www.adventuregamestudio.co.uk/manual/StopChannel.htm). (Check your manual too - depending on which version you have you may have more channels to play with.)
I tried to use a .mp3, and it doesn't work. It just doesn't play.
I'm using Proskito's MI2 GUI, by the way.
I hate to double post, but I've still got a problem here, and if I didn't, I'd have to make a new thread so somebody would see it.
How can I convert it to a different file type? That might work.
So don't double post, just edit your last post and have a bit more patience.
Google for encoders / decoders (such as Audacity (http://audacity.sourceforge.net/about/), which is free) - obviously, there's no way to covert file types using AGS itself.
Obvious, but worth checking: what version of AGS are you using, and where are you putting the .MP3 files? (Before V2.71 they should be in the main game - not 'Compiled' - folder, after they should be in the 'Music' folder.) Is there any error message, or does it just not play? What are your system volume settings like - is it possible the file is playing and you just can't hear it?
Finally, does it work if you try the same thing, but in a game not using the MI template? (Would help, to locate the problem.)
Well, if I didn't double post, since the thread was so old nobody would probably see it, they would think it's already solved.
Whoever made this forum (I don't know who made it) should probably add a "delete" button so people can delete their own post, like other forums-or make modified posts count as "new" posts. That would make a lot more sense...
I forgot about which folder to put it in, since I was playing them as sound files. I tried again, and it still doesn't work.
It just doesn't play. The speaker was up all the way.
Is AGS supporting Wav format ?
Yes, but not as music. Read the manual for more details.
And it only supports uncompressed PCM format wave files.
If you download stuff from the internet, oftentimes they're compressed with ADPCM or something. You can use (for example) Audacity (http://audacity.sourceforge.net/) to save them back to uncompressed PCM format.
I didn't download it, it works fine as sound, just not as music, and I really need it to work as music so I can stop it...
So.
I'll try Audacity to convert them.
For music, use OGG or MP3, WAV is not supported even if it's not compressed.
Okay, I tried to use a .OGG file as music, and it doesn't work. It just doesn't play.
Nor does a .mp3 or .wav file.
.Wav files are only working as sound.
So what do I do?
I chose "play music" action on both "player enters screen (before fadein)" and "(after fadein)".
Did you try rebuilding the music.vox first?
Also, depending on the version of AGS you're using, for V2.7 and earlier the sound files were all initially placed into the game's folder, for V2.71 and on you need to put the music files in the Music subfolder.
I read the manual, and it says you only need to do that for .wav files, and yes, I did, with the .wav files.
I have the latest version of AGS, and I didn't get any "Music" subfolder, so I made a folder named "Music" in the AGS folder, and put it in there.
I tried both folders, though.
Quote from: Grapefruitologist on Wed 01/03/2006 09:04:34I have the latest version of AGS, and I didn't get any "Music" subfolder, so I made a folder named "Music" in the AGS folder, and put it in there.
Wait...you made the "Music" subfolder
in the AGS folder? You mean in the main AGS folder? Not within the game folder? Because if so, that could be your problem right there...
Oh! Duh!
Apparently, looking at the folder, I already tried that, but gave up and forgot about it because it wasn't playing .wav files.
EDIT: It STILL doesn't work! xD What are the chances of that?
Quote from: Grapefruitologist on Wed 01/03/2006 09:21:06
EDIT: It STILL doesn't work! xD What are the chances of that?
Did you mean it didn't work for .WAV musics? .WAV
never works for musics, use MP3 or OGG instead, also, remember to
rebuild music.vox after moving the files to correct position.
No, it doesn't work for ANY of the soundfiles (that is, the .OGG file either)
Did you check if the crappy option "hide known extensions" was enabled (it was foolishly enabled by default when windows was installed) in your file manager?
It could be possible that the files were infact called something like music1.ogg.ogg, which obviously won't work.
How do I get to my file manager?
You can't open the windows file manager? I think this is sometimes called something like... Explorer... though.
I've just never heard of such a thing, heh.
Do you mean "Windows Task Manager"/what you get when you push ctrl + alt + del?
No, Windows Explorer (there should be a shortcut to it somewhere in the start menu), or you can click My Computer - whatever you use for looking at the contents of your Hard Drive(s).
Then 'Tools', 'Folder Options', 'View' and about half way down should be a checkbox for 'Hide extentions for known file types'.
Ok, it was on, but no, it's just MUSIC2.ogg.
Well, to sum up:
- Put your music2.ogg file into the AGS\YourGame\Music folder.
- Under Player enters room (before fade-in) add Game - Play music (2).
Alternatively, you can use the Play music on room load option from the Room settings -- just enable it and put music number in there.
- Just to be sure, press Ctrl-B to rebuild VOX files. AGS should automatically ask you and do this when you add music/sound and then save/test the game but do it yourself just to be on a safe side.
- Now goto the setup (Main menu --> File --> Setup game...)
- Ensure the following:
- Use digital music pack if available is enabled.
- Digital sound: Default DirectSound or Default WaveOut -- i.e. sound must be enabled.
- MIDI music: Default MCI music or Win32 MIDI mapper -- i.e. music must be enabled too.
- Try running the game, and see if it helps at all.
Also, if that won't help try starting a new game (using Default template) and test music there.
On a fun side :)
We can indeed have WAV music to be played in AGS!
Really, AGS is meant to support WAV music files since version 2.06, March
2000!!In fact, the manual too claims AGS does support music in WAV format.
Some history, I kinda like how it's been progressing:
VERSION 2.06, March
2000 - Added WAV background music support.
VERSION 2.22, December
2001 - Changed music search order to MP3, WAV, MID, MOD, XM.
VERSION 2.62, November
2004 - Fixed WAV music not getting included in the MUSIC.VOX
VERSION
2.71, December
2005 - Fixed WAV music files not being picked up from MUSIC.VOX
Which actually says more than enough on how often this feature is called for...
:=
I've tried all of that.
I tried .ogg, .wav, .mp3 files, I tried to rebuild the VOX files, I tried them in my game's music folder, I tried them in the main folder, I checked the setup, I checked the volume of my speakers, I tried a ton of things that I can't even remember right now.
None of them work.
Could it be a bug?
1. Have you tried doing a new game clear test, as Ashen suggested before?
Just start with the Default game template instead of the MI one, and try playing music there.
This way you can test whether the problem is related to MI template in any way.
2. If that won't help, open your "Game\Compiled" folder and check if music.vox is actually there. If it's not, the digital music will not play.
3. On a side note...
What Windows version are you running?
And to be confident, what version of AGS are you using? (you can check it out via "Main menu --> Help --> About...", look for that number next to Build)
Are your speakers plugged in?
Can you listen to music in Windows?
(Very basic questions, I know, but it's essential to make sure it's none of the things so obvious one tends to forget them.
"Help, I can't login!"
-"How many green lights on the keyboard?"
"Two!" ;) )
Yes, I've been listening to music every day.
2.71, and Windows XP.
I tried to start a new game to test it, but it says my graphics card doesn't support it or something.
Also, sometimes I get an error that says "Sound card did not initialize" or something like that.
Quote from: Grapefruitologist on Wed 08/03/2006 06:04:17I tried to start a new game to test it, but it says my graphics card doesn't support it or something.
This may happen when you run at resolution your graphics card doesn't support.
The easiest workaround would be to run it in a windowed mode. In the setup -->
Run in a window instead of full screen.QuoteAlso, sometimes I get an error that says "Sound card did not initialize" or something like that.
Not sure, but it can possibly be caused by the first error, after the initialization of the video subsystem failed. So, deal with the first one.
*And make sure to check if
music.vox is actually there (in the Compiled folder)!*
Um... no, it isn't!
I rebuilt the .VOX files, though...
Sorry for posting twice, but seeing as this thread is like 3 weeks old and on the second page...
What do I do? The .vox files aren't there.
Just check again, did you put the music files in the music folder inside the folder holding your game's source?
Under normal condition, it should be something like:
AGS ---- Mygame ----- Compiled
|
--- Music <--- put music files here
Yes, they're here:
C:\Program Files\AGS\AGS\MI\Music
I'm sorry for double posting, but seeing as this thread is on the very bottom of the third page...
Does anyone know ANY solution to my problem? Do you think it's a bug? I can't think of it being anything else...
Is there any alternative?
If you add new music files/edit your after rebuilding the VOX files it could go the wrong way.
Maybe you should make an empty file named music.vox (or whatever it needs to be called) and rebuild the vox files. Maybe they'll overwrite the empty file and solve your problem.
Tried it... didn't work.