Music, Sound & Speech: Difference between revisions
m
no edit summary
*>Dasjoe mNo edit summary |
mNo edit summary |
||
(14 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
{{deprecated}} | |||
==Getting sound/music into your game== | |||
''How do I get sound/music into my game? Is there a menu or editor within AGS that I can use to add music/sound files into, or what?'' | ''How do I get sound/music into my game? Is there a menu or editor within AGS that I can use to add music/sound files into, or what?'' | ||
Nope. It's actually very simple. To use sound effects, you may need to use script, or the "'''Game - play sound effect'''" and "'''Game - play music'''" | Nope. It's actually very simple. To use sound effects, you may need to use script, or the "'''Game - play sound effect'''" and "'''Game - play music'''" actions in the interaction editor (on the other hand, sound effect for a score increase, can be set in the General pane of the AGS Editor). Check out the '''PlaySound()''' command in the AGS manual. To do it via the interaction editor approach, just choose the interaction editor (the button with the letter 'i', which is available in several panes of the editor), you can use room/object/whatever interactions and choose the correct event (like "'''player enters room'''" or "'''player looks at hotspot'''" or whatever), and find the "'''Game - play sound'''" or "'''Game - Play music'''" event. Then, simply choose the sound/music number. For music, you might also be able to set a certain background music file to play upon entering a room. This can be found in the '''Rooms/Settings''' pane, with a "'''Play music on load'''" checkbox and a text box beside it, where you can type in the number. If you way '''Music4.mid''' or '''Music4.mp3''' (only one '''Music4.*''' file can exist at a time) to play, simply type in the number 4. | ||
For speech, that's a whole different matter altogether. You need to use scripting, whether it's text scripting or dialog scripting. Check the manual for more information on speech. (Simply search for "Speech" under the Index tab.) | For speech, that's a whole different matter altogether. You need to use scripting, whether it's text scripting or dialog scripting. Check the manual for more information on speech. (Simply search for "Speech" under the Index tab.) | ||
==Music/speech/sound not working properly or at all== | |||
''My music/speech/sound doesn't work.'' | ''My music/speech/sound doesn't work.'' | ||
{{non-OOP}} | |||
''newer AGS versions have subfolders of the game folder for music and speech (AGS 2.71+) and sound effects (2.72)'' | |||
Even though this is too general a question to ask (what happens exactly, what did you do, what does your script look like?), there are several steps you can take to double-check that everything is okay: | Even though this is too general a question to ask (what happens exactly, what did you do, what does your script look like?), there are several steps you can take to double-check that everything is okay: | ||
# Make sure you enable sound and midi options at File->Setup Game, if you dont, it wont work, that simple | |||
# Did you remember to name them "MusicXX.???" or "SoundXX.???" accordingly? XX would be the order number (like Music4.mid or Sound23.voc), and ??? would be the file format extension (MID, MP3, OGG, XM, etc. for music; WAV, VOC, MP3, OGG, etc. for sound/speech). | # Did you remember to name them "MusicXX.???" or "SoundXX.???" accordingly? XX would be the order number (like Music4.mid or Sound23.voc), and ??? would be the file format extension (MID, MP3, OGG, XM, etc. for music; WAV, VOC, MP3, OGG, etc. for sound/speech). | ||
# If you're using speech, did you remember to use the correct scripting format? Check the manual for more information on this. | # If you're using speech, did you remember to use the correct scripting format? Check the manual for more information on this. | ||
Line 21: | Line 27: | ||
However, if none of this works, ask us at the AGS Beginners' Forum. If it's too tough for us to answer, we'll move it to the Advanced Tech Forum. If they can't answer it, then take a machine gun to your computer and start cross-dressing. We'll all be better off anyway. :P | However, if none of this works, ask us at the AGS Beginners' Forum. If it's too tough for us to answer, we'll move it to the Advanced Tech Forum. If they can't answer it, then take a machine gun to your computer and start cross-dressing. We'll all be better off anyway. :P | ||
==Inability to hear new music/sound/speech after adding them in== | |||
''I added new music/sound/speech files and now I can't hear them. What should I do?'' | ''I added new music/sound/speech files and now I can't hear them. What should I do?'' | ||
AGS uses a '''Speech.VOX''' or '''Music.VOX''' file to store all the sound files into (with some exceptions such as MIDI files, which are stored inside the game data files). If you add new music/sound, you need to click on '''Game -> Rebuild VOX files''' to re-compile all the '''.VOX''' files used by AGS. | AGS uses a '''Speech.VOX''' or '''Music.VOX''' file to store all the sound files into (with some exceptions such as MIDI files, which are stored inside the game data files). If you add new music/sound, you need to click on '''Game -> Rebuild VOX files''' to re-compile all the '''.VOX''' files used by AGS. | ||
==Error: "Unable to initialize your audio hardware (problem: Failed to init digital sound driver)"== | |||
''When I test my game (which has NO sound or music yet), OR when I play someone else's game, I get an error that says, “Unable to initialize your audio hardware (problem: Failed to init digital sound driver)”. What is the problem?'' | ''When I test my game (which has NO sound or music yet), OR when I play someone else's game, I get an error that says, “Unable to initialize your audio hardware (problem: Failed to init digital sound driver)”. What is the problem?'' | ||
Line 35: | Line 41: | ||
# Also, a much quicker way is to open up the Game Setup window in AGS and change the digital sound setting from "Default Direct Sound" to "Default WaveOut Device". | # Also, a much quicker way is to open up the Game Setup window in AGS and change the digital sound setting from "Default Direct Sound" to "Default WaveOut Device". | ||
==Adding footstep sounds to each of your characters' footsteps== | |||
''How would I set it up so that every time my character takes a step (their foot hits the floor/ground), AGS plays a footstep sound? And how would I change the footstep sound depending on the surface type?'' | ''How would I set it up so that every time my character takes a step (their foot hits the floor/ground), AGS plays a footstep sound? And how would I change the footstep sound depending on the surface type?'' | ||
Line 44: | Line 50: | ||
Just a side note: This function can be useful for a LOT of other things. For example, you could have it so that your character has the ability to become injured. Maybe at that point, you could change his view to one where he limps, with each footstep playing a grunt sound. To make it even more realistic, you could randomize the grunt sound as well, with the '''SetFrameSound()''' command and the '''repeatedly_execute''' game function. Just a thought. | Just a side note: This function can be useful for a LOT of other things. For example, you could have it so that your character has the ability to become injured. Maybe at that point, you could change his view to one where he limps, with each footstep playing a grunt sound. To make it even more realistic, you could randomize the grunt sound as well, with the '''SetFrameSound()''' command and the '''repeatedly_execute''' game function. Just a thought. | ||
==Getting the background music to play continuously from room to room== | |||
''What do I have to do in order to keep my background music playing from room to room?'' | ''What do I have to do in order to keep my background music playing from room to room?'' | ||
Quite simply, nothing. Just don't tell AGS to stop playing the music until you reach the room in which you want the music to stop. Then, just play new music or stop it altogether, whichever you want. AGS plays music from room to room automatically until you tell it otherwise. | Quite simply, nothing. Just don't tell AGS to stop playing the music until you reach the room in which you want the music to stop. Then, just play new music or stop it altogether, whichever you want. AGS plays music from room to room automatically until you tell it otherwise. | ||
However, if you change tracks and then come back to the original music, it will start againfrom the beginning unless you use the [[Continuous Music]] Module. | |||
==Fading out MIDI music upon entering a new room== | |||
''How would I go about fading out MIDI music, say, upon entering a new room where the music is longer desired?'' | ''How would I go about fading out MIDI music, say, upon entering a new room where the music is longer desired?'' | ||
Line 100: | Line 108: | ||
And that's it! Many thanks to '''rozojc''' for the code! | And that's it! Many thanks to '''rozojc''' for the code! | ||
('''Note:''' if you're using AGS V2.7 and above, you may need to comment the lines marked with comment "'''Comment for V2.7+'''" and uncomment the lines marked with comment "'''Uncomment for V2.7+'''".) | ('''Note:''' if you're using AGS V2.7 and above, you may need to comment the lines marked with comment "'''Comment for V2.7+'''" and uncomment the lines marked with comment "'''Uncomment for V2.7+'''".) | ||
[[Category:Beginner Tutorials]] |