Create an Elm app that supports playing audio.
Browser.document but with the ability to play sounds.
Browser.application but with the ability to play sounds.
Alias for Platform.Program
Load audio so you can later play it.
An audio command.
Possible errors we can get when loading audio files.
Map a command from one type to another. Conceptually the same as Cmd.map
Combine multiple commands into a single command. Conceptually the same as Cmd.batch.
Define what audio should be playing.
Some kind of sound we want to play. To create Audio start with audio.
Play audio from an audio source at a given time. This is the same as using audioWithConfig audioDefaultConfig.
Play audio from an audio source at a given time with config.
Default config used for audioWithConfig.
Extra settings when playing audio from a file.
Control how audio loops. loopEnd defines where (relative to the start of the audio) the audio should loop and loopStart where it should loop to.
-- Here we have a song that plays an intro once and then loops between the 10 second point and the end of the song.
let
default =
Audio.audioDefaultConfig
songLength =
Audio.sourceDuration coolBackgroundMusic
in
audioWithConfig
{ default | loop = Just { loopStart = Duration.seconds 10, loopEnd = songLength } }
coolBackgroundMusic
startTimeEffects you can apply to Audio.
Scale how loud a given Audio is. If the the volume is less than 0, 0 will be used instead.
Scale how loud a given Audio is given points in time. The volume will transition linearly between those points.
WIP support for Lamdera. Ignore this for now.
Lamdera.frontend but with the ability to play sounds (highly experimental, just ignore this for now).
Get the user state stored in Model.
Set the user state stored in Model. Useful for dealing with migrations in Lamdera.
Change the userMsg type in Model. Useful for dealing with migrations in Lamdera.
Browser.element but with the ability to play sounds.