Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Grapefruitologist on Wed 22/02/2006 09:10:30

Title: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Grapefruitologist on Wed 22/02/2006 09:10:30
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?
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Ashen on Wed 22/02/2006 10:54:01
.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.)
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Grapefruitologist on Thu 23/02/2006 02:59:31
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.
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Ashen on Thu 23/02/2006 23:30:08
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.)
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Grapefruitologist on Sun 26/02/2006 06:48:08
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.
Title: Is AGS supporting Wav format ?
Post by: kantor_98 on Tue 28/02/2006 09:18:09
Is AGS supporting Wav format ?
Title: Re: Is AGS supporting Wav format ?
Post by: Gilbert on Tue 28/02/2006 09:21:23
Yes, but not as music. Read the manual for more details.
Title: Re: Is AGS supporting Wav format ?
Post by: strazer on Tue 28/02/2006 11:52:04
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.
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Grapefruitologist on Wed 01/03/2006 02:56:47
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.
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Gilbert on Wed 01/03/2006 03:30:09
For music, use OGG or MP3, WAV is not supported even if it's not compressed.
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Grapefruitologist on Wed 01/03/2006 07:55:24
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)".
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Gilbert on Wed 01/03/2006 08:50:47
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.
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Grapefruitologist on Wed 01/03/2006 09:04:34
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.
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Alun on Wed 01/03/2006 09:14:18
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...
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Grapefruitologist on Wed 01/03/2006 09:21:06
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?
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Gilbert on Wed 01/03/2006 10:01:18
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.
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Grapefruitologist on Wed 01/03/2006 23:43:34
No, it doesn't work for ANY of the soundfiles (that is, the .OGG file either)
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Gilbert on Thu 02/03/2006 02:21:04
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.
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Grapefruitologist on Thu 02/03/2006 03:58:14
How do I get to my file manager?
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Gilbert on Thu 02/03/2006 04:00:35
You can't open the windows file manager? I think this is sometimes called something like... Explorer... though.
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Grapefruitologist on Thu 02/03/2006 05:01:57
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?
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Ashen on Thu 02/03/2006 10:37:59
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'.
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Grapefruitologist on Fri 03/03/2006 03:23:31
Ok, it was on, but no, it's just MUSIC2.ogg.
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Scorpiorus on Mon 06/03/2006 23:49:55
Well, to sum up:



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...

:=
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Grapefruitologist on Tue 07/03/2006 09:11:37
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?
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Scorpiorus on Tue 07/03/2006 16:07:47
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)
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Khris on Tue 07/03/2006 23:56:22
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!" ;) )
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Grapefruitologist on Wed 08/03/2006 06:04:17
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.
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Scorpiorus on Wed 08/03/2006 20:36:01
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)!*
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Grapefruitologist on Thu 09/03/2006 22:20:01
Um... no, it isn't!
I rebuilt the .VOX files, though...
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Grapefruitologist on Tue 14/03/2006 05:13:44
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.
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Gilbert on Tue 14/03/2006 06:52:48
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
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Grapefruitologist on Tue 14/03/2006 15:36:10
Yes, they're here:
C:\Program Files\AGS\AGS\MI\Music
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Grapefruitologist on Sun 26/03/2006 05:03:09
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?
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: A�rendyll (formerly Yurina) on Mon 27/03/2006 09:45:13
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.
Title: Re: Problem with Stopping Music/Sound Effects/Wav Files
Post by: Grapefruitologist on Mon 27/03/2006 21:27:07
Tried it... didn't work.