SharpMik icon indicating copy to clipboard operation
SharpMik copied to clipboard

Getting started

Open veso266 opened this issue 6 years ago • 7 comments

Hi do you think you could tell me simply how to play a mod or s3m file with this library

I've tried like this

ModPlayer.SetFixedRandom = true;
            int result = 0;
            int iterations = 0;
            String modName = null;
            DateTime startTime = DateTime.Now;
            Module mod;
            ModDriver.LoadDriver<NoAudio>();
            ModDriver.MikMod_Init("");
            mod = ModuleLoader.Load("Music1.mod");
            modName = "Music1.mod";
            int lookingForByte = -1;
            int byteCount = 44; // wav header
            DateTime loadTime = DateTime.Now;
            ModPlayer.Player_Start(mod);

            // Trap for wrapping mods.
            while (ModPlayer.Player_Active() && iterations < 5000)
            {
                if (lookingForByte > 0)
                {
                    int test = byteCount + (int)WavDriver.BUFFERSIZE;
                    if (test > lookingForByte)
                    {
                        Debug.WriteLine("Will fail on the next pass, at {0} byes in", (lookingForByte - byteCount));
                    }
                }

                ModPlayer.Player_HandleTick();
                byteCount += (int)WavDriver.BUFFERSIZE;
                iterations++;
            }

but when I run the program I can't hear anything

Thanks for Anwsering and Best Regards

veso266 avatar Mar 04 '18 19:03 veso266