Music, Sound & Speech: Difference between revisions

m
no edit summary
*>SSH
(→‎Music/speech/sound not working properly or at all: mentioned subfolders in newer AGS versions)
mNo edit summary
 
(11 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{deprecated}}
==Getting sound/music into your game==
==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'''" action 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.
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.)
Line 10: Line 12:


{{non-OOP}}
{{non-OOP}}
''newer AGS versions have subfolders of the game folder for music and speech''
''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 51: Line 54:


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==
==Fading out MIDI music upon entering a new room==
Line 104: Line 109:
('''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:The AGS Beginners' FAQ]]
[[Category:Beginner Tutorials]]
310

edits