1 Validation Errors

  • form: You are not authorized to edit wiki pages

allegrosound

Sound and allegro

Allegro has several sound functions to load and play .wavs, .mods and .mid files. Unfortunately it wont't play .mp3s. There is an almp3 dll module, but this was compiled for allegro 4.0 - if anyone has a copy of the almp3 source, and can compile it for allegro mp4. then that would be a great help - you could then keep all sound playing 'in house'.

However, FMOD does a very good job of playing .mid, .mp3, .wav, .ogg, .mod, .s3m, .it and .xm. The version included here is very old (fmod has moved on like everything else), and while there is no cost for it, as far as I am aware, you cannot distribute your game with it and charge money, although giving it away is (was) allowed. for more details, and it probably still applies to this version 3.6 dll, go to https://www.fmod.com/licensing

Having said that , if you do end up needing an fmod license, very very well done to you!

Using allegro sound is covered in the examples, and on the quick reference.

The original Fmod wrapper was originally written by Aku - I just pulled it apart, used English for function names (sorry, not sure what language it was), and change how the functions were linked. Thanks to Aku.

Using fmod is very simple, and similar to allegro - see Fmodtest.exw for examples of how to use it - there are other functions that could be wrapped, and I probably will one day, especially if I need them.

The functions wrapped from fmod so far are

FSOUND_Init
FSOUND_GetCPUUsage
FMUSIC_LoadSong
FMUSIC_PlaySong
FMUSIC_StopSong
FMUSIC_FreeSong
FMUSIC_GetTime
FMUSIC_StopAllSongs

FSOUND_Stream_OpenFile
FSOUND_Stream_Close
FSOUND_Stream_Stop
FSOUND_Stream_Play
FSOUND_Stream_GetLengthMs
FSOUND_Stream_GetLength
FSOUND_Stream_GetTime
FSOUND_Stream_GetPosition
FSOUND_Stream_SetTime
FSOUND_Stream_SetPosition

FMUSIC_SetReverb
FSOUND_SetVolume
FSOUND_SetVolumeAbsolute
FMUSIC_SetMasterVolume

FSOUND_Sample_Load
FSOUND_PlaySound
FSOUND_Sample_SetMode
FSOUND_Sample_Free

FSOUND_SetLoopMode
FSOUND_SetPan

Generally, FMUSIC applies to music streams, and FSOUND applies to sound samples, of which mp3 s are a type.

The full api to use FMOD and FSOUND can be found at FSOUND and FMUSIC

Search



Quick Links

User menu

Not signed in.

Misc Menu