Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
Basically 3 variables: sound.start, sound.end, and sound.loop.

sound.start: When playing the sound, the sound starts here, and continues to loop from here. specified in bytes.

sound.end: When playing the sound, the sound ends here, and if looping, continues back from sound.start.

sound.loop: When looping a sound, the sound begins from here, allowing for the intro to be included in the sound initially. The sound will loop from sound.start when the sound reaches sound.end.

sound.start would be initialized to 1, while sound.end could be initialized to 0 (which which be considered the final byte in the sound).

sound.loop would default to sound.start if not explicitly defined.

This feature would be rather useful for projects using background music with an intro that's not supposed to play upon loop.
I'm gonna bump this again.
This would be really nice, but I'm not entirely sure it's doable, because of licensing issues. BYOND uses a very specific version of FMOD, and it's not possible to change that because the newer FMOD licenses aren't compatible with BYOND's licensing/code setup.

tl;dr if Tom/Lummox want to change anything related to audio, there's a huge amount of work that has to go into it.
This sort of thing comes up every now and then, but as far as I know it hasn't ever been added. Being able to loop sounds from specific points at a software level without having to cut the sound file up into smaller pieces beforehand is something FMOD is supposed to support.
For a work-around, you could always play the music through a web-link , I think that would let you manipulate it kind of how you want, maybe I'm wrong though
You can @cloudmagic, but will take some web knowledge and some javascript.
html5 makes this a cinch, by the way.

var sound = new Audio('file.ogg');

function play(snd,pos){


Now if only we weren't relegated to compatibility mode I.E. ...
Since the html5 client sounds like it'll be in beta soon (provided plans don't change too much), you won't need to be.
I already got some ideas for this client :p
Having the html5 client doesn't necessarily mean you'll be able to utilise html5 at runtime. I don't see anything indicating that you can.
Not using the executable client, no, but from what I've gathered the game developer can alter the page around their game all they want, meaning you'll be able to utilize anything you can show in the client's browser alongside the game.
Post #12. Using javascript will allow you to interact with the html.
With BYOND moving into 509, would this be possible without browser controls or the webclient anytime soon?
This is a sampler trick that's used a lot in many sounds. A sound has an introduction to it, a looped section and an outro for smooth transitioning.

While this would be a very nice built-in feature, the best work around is to break the sample up into these individual parts. You can easily do this through most DAW setups.

The best bet is to just use different sounds in conjunction to give the best effect.
I forgot about this Feature Request, but it's still a feature I would like to see someday.
I've been doing some work on optimising resource file sizes for a game with large numbers of players (and regular updates) and while migrating some of the sound resources back to a sampler format for file size reduction I thought of this same thing.

A lot of regularly used files might play something basic several times start to finish which is redundant encoding if we could just tell BYOND to play the sound x times.

As for the 'play from position' part, FMODEx already supports a sample accurate seek and extract/play granularity so the audio system is capable of it. (Unless I'm hideously mistaken on what sound engine BYOND is running). So you might not be able to 'play/loop from timestamp' but if you calculate the sample number when you write the sound play code you can make it play from there or play a sample range snippet.

At the least adding extra functions to the 'repeat=x' argument might give us the loop ability. Since positive numbers 1 (loop forever) and 2 (play back and forward) are already in use, it could be added as negative numbers for 'loop x times' ie 'repeat=-3' would play the sound file 3 times end to end before stopping.

A work around for someone wanting to 'start a song and play it for a long time/forever without the intro looping or it being a hideously large file' may be to get a hold of the song (or rebuild it) in a tracker/sampler format (Try OpenMPT or ReNoise) as you can in effect make a sampled file play forever after the intro by adding a loop command to the end of it.
The samples are usually in WAV (or FLAC for Impulse Tracker if you use OpenMPT and change some settings), or if you want to push it, OGG for FastTracker with OggMod, which is an FMODEx only version of sample encoding/storage.