Loads a MOD music file.
HMUSIC BASS_MusicLoad( DWORD filetype, void *file, QWORD offset, DWORD length, DWORD flags, DWORD freq );
filetype | One of the following.
| ||||||||||||||||||||||||||||||||||||||||||||||
file | The file as described by filetype. | ||||||||||||||||||||||||||||||||||||||||||||||
offset | File offset to begin reading from. | ||||||||||||||||||||||||||||||||||||||||||||||
length | Maximum read length... 0 = to the end of the file. | ||||||||||||||||||||||||||||||||||||||||||||||
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_ILLPARAM | filetype and/or length is invalid. length cannot be 0 when loading from memory. |
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; sensitive 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.
On Android, when using Java, file may be one of the following: String, ByteBuffer, ParcelFileDescriptor (Android 3.1 and above), BASS.Asset. A ParcelFileDescriptor will remain open after this function returns.