Loads a MOD music file.
HMUSIC BASS_MusicLoad( BOOL mem, void *file, QWORD offset, DWORD length, DWORD flags, DWORD freq );
mem | TRUE = load the MOD music from memory. | ||||||||||||||||||||||||||||||||||||||||||||||
file | Filename (mem = FALSE) or a memory location (mem = TRUE). | ||||||||||||||||||||||||||||||||||||||||||||||
offset | File offset to load the MOD music from (only used if mem = FALSE). | ||||||||||||||||||||||||||||||||||||||||||||||
length | Data length... 0 = use all data up to the end of file (if mem = FALSE). | ||||||||||||||||||||||||||||||||||||||||||||||
flags | A combination of these flags.
| ||||||||||||||||||||||||||||||||||||||||||||||
freq | Sample rate to render/play the MOD music at... 0 = the rate specified in the BASS_Init call, 1 = the device's current output rate (or the BASS_Init rate if that is not available). |
BASS_ERROR_INIT | BASS_Init has not been successfully called. |
BASS_ERROR_NOTAVAIL | The BASS_MUSIC_AUTOFREE flag is unavailable to decoding channels. |
BASS_ERROR_FILEOPEN | The file could not be opened. |
BASS_ERROR_FILEFORM | The file's format is not recognised/supported. |
BASS_ERROR_FORMAT | The sample format is not supported. |
BASS_ERROR_SPEAKER | The specified SPEAKER flags are invalid. |
BASS_ERROR_MEM | There is insufficient memory. |
BASS_ERROR_NO3D | Could not initialize 3D support. |
BASS_ERROR_UNKNOWN | Some other mystery problem! |
MO3s are treated and used in exactly the same way as normal MOD musics. The advantage of MO3s is that they can be a lot smaller with virtually identical quality. Playing a MO3 does not use any more CPU power than playing the original MOD version does. The only difference is a slightly longer load time as the samples are being decoded. MO3 files are created using the MO3 encoder available at the BASS website.
DMO effects (the same as available with BASS_ChannelSetFX) can be used in IT and XM files (and MO3 versions of them) created with Modplug Tracker. This allows effects to be added to a track without having to resort to an MP3 or OGG version, so it can remain small and still sound fancy. Of course, the effects require some CPU, so should not be used carelessly if performance is key.
"Ramping" does not take a lot of extra processing and improves the sound quality by removing clicks, by ramping/smoothing volume and pan changes. The start of a sample may also be ramped-in. That is always the case with XM files (or MOD files in FT2 mode) when using normal ramping, and possibly with all formats when using sensitive ramping; senstitive ramping will only ramp-in when necessary to avoid a click. Generally, normal ramping is recommended for XM files, and sensitive ramping for the other formats, but some XM files may also sound better using sensitive ramping.
After loading a MOD music from memory (mem = TRUE), the memory can safely be discarded.
On Android, file may be a String, ByteBuffer, ParcelFileDescriptor, or asset (via the Asset class) when using Java. See the BASS.JAVA file for available overloads.