Looping a sound: Difference between revisions
(remove misleading and malformed information) |
SirYodaJedi (talk | contribs) (The popping is due to the fixed sample sizes, not the compression itself. It doesn't always occur, and can usually be avoided by careful cue positioning.) |
||
Line 5: | Line 5: | ||
A looped sound will repeat endlessly without any gap between its end and start. It is up to the sound artist to ensure that the end and start of the file match up however, or there will be a "pop" as the waveform jumps from one shape to another. | A looped sound will repeat endlessly without any gap between its end and start. It is up to the sound artist to ensure that the end and start of the file match up however, or there will be a "pop" as the waveform jumps from one shape to another. | ||
'''Source detects looped sounds ONLY through cue points embedded in the file.''' This is a WAV-only feature, so MP3s cannot be looped. MS-ADPCM compressed WAVs can be looped, but due to the | '''Source detects looped sounds ONLY through cue points embedded in the file.''' This is a WAV-only feature, so MP3s cannot be looped. MS-ADPCM compressed WAVs can be looped, but due to the way they are encoded, there will may a pop when the sound restarts. ([http://www.compuphase.com/mp3/mp3loops.htm But that can theoretically be avoided for any compressed format, including MP3.]) | ||
{{note|There is no need to mark a sound as looping when playing it, but if using [[ambient_generic]] you will find that the "Is NOT Looped" flag must be set correctly if you want to stop the sound after it starts!}} | {{note|There is no need to mark a sound as looping when playing it, but if using [[ambient_generic]] you will find that the "Is NOT Looped" flag must be set correctly if you want to stop the sound after it starts!}} | ||
Line 15: | Line 15: | ||
These free programs can add cue points to a WAV: | These free programs can add cue points to a WAV: | ||
* [http://www.goldwave.com/ GoldWave] | * [http://www.goldwave.com/ GoldWave] (trialware) | ||
* [http://www.wavosaur.com/ Wavosaur] | * [http://www.wavosaur.com/ Wavosaur] (freeware) | ||
=== GoldWave === | === GoldWave === |
Revision as of 09:37, 18 November 2022
A looped sound will repeat endlessly without any gap between its end and start. It is up to the sound artist to ensure that the end and start of the file match up however, or there will be a "pop" as the waveform jumps from one shape to another.
Source detects looped sounds ONLY through cue points embedded in the file. This is a WAV-only feature, so MP3s cannot be looped. MS-ADPCM compressed WAVs can be looped, but due to the way they are encoded, there will may a pop when the sound restarts. (But that can theoretically be avoided for any compressed format, including MP3.)



Programs
These free programs can add cue points to a WAV:
GoldWave
Open Goldwave and open the sound you want to loop. Click the cues icon. ()
Then in the new window click on the New button and add a cue point At Start. Then click New for another cue point and add a point At End. So it looks similar to this:
Wavosaur
Open Wavosaur and open the sound you want to loop. Go to Tools > Loop > Create loop points
. It should create loop points. You can change their positions by dragging them.
After that, click "Save" or "Save As" AND go to File > Export > Export All Regions
. If you miss the last step, the sound won't loop in-game!



Create loop points
function in Wavosaur. If this happens, try setting only the starting cue by using a marker instead (Tools > Loop > Create marker
).Cue location
Your cues do not have to be at the start and end of the file. If you place them in the middle Source will start playing the sound normally, then when it reaches the end cue will loop back to the start cue. From then on only what's between the cues will play.

This can be used to give a sound a "winding up" effect that only plays once (e.g. a motor starting).
Looping an MP3
MP3 files can't be looped with start/end queues like a WAV. A logic_timer can be a good workaround; have it start playing the sound again after it has fully played (or has played to the point desired).
This could also be done using User I/O from the ambient_generic
to itself, and an input delay.
See Also
External Links
- Looping Menu Music - An Interlopers.net Tutorial on Soundlooping