I have an example for FMOD on playing MOD, IT, XM, and S3M file in VB. Could you include it in the downloads? The default only plays streaming audio using FSOUND. The code is very clear, but I didn’t use FMOD.BAS as I perfer copying and pasting the API’s I needed.
Source is of course, there. Compiled version too. Although it is not really a sample, I just made it for fun and my own use as I don’t like to use WinAmp, or ModPlug very much as they have bad interfaces. By the way, how do you find out how long it takes to play a MOD, IT, XM, or S3M file?
I use the following routines to calculate the lenght of mods,xms,its,s3ms, it seems to work with every module i have tried though some say it will fail on some select modules.
sng_BPM = FMUSIC_GetBPM(STRM)
sng_Speed = FMUSIC_GetSpeed(STRM)
sng_KBPS = ((sng_BPM * 2) / 5) st = ((1 / sng_KBPS) * 1000) * sng_Speed For i = 0 To (sng_NumOrders - 1) t = t + FMUSIC_GetPatternLength(STRM, i) Next i sng_LenInBytes = t sng_LenInMS = t * st
the sng_NumOrders of course you need to get from Fmod via sng_NumOrders = FMUSIC_GetNumOrders(STRM) I hope this works. P.S. If you really like a good player check out mod4win which is now freewhere at [url:2blrsw2f]http://pjeantaud.free.fr/mod4win/english.html[/url:2blrsw2f] Take a peek at the [b:2blrsw2f]effects[/b:2blrsw2f] Very cool, especially on mods with alot of channels and effects. This is something I would love to implement into my player however it is currently beyond my knowledge of fmod, or maybe even beyound fmods current abilities in VB.
It is very difficult to find the actual length of a MOD-based song due to the tempo changes and the jump command. This means that the song must be played internally as fast as possible to try to calculate the length. If there is a jump command, where does the song actually end? No-one knows.
I have a MOD that WinAmp seems to hang on while calculating the length, but after a minute or so it comes up with a length of approximately 292,000 seconds.
Why not ignore jumps. I know where it is in the file. I tried making one player without fmod.dll, when I read the format, it was too complex. well, if you read to the end, use file size. You will have it done. But I don’t understand the odd format in the way they put rows, channels.
Please login first to submit.