This is what you all have been waiting for: AHX Replayer SDK (Win32) v0.9 ============================= 1. Introduction --------------- If you don't know what AHX is all about until now, you shouldn't read any further... All other people will be glad to hear that you've finally got a PC-replayer usable in your own productions. This version is still a pre-release, where the player works fine, but there are still several features missing (e.g. DirectSound output etc.) 2. Requirements --------------- - Microsoft Visual C++ 4.0 (or above) or any other C++ compiler that is able to link with "Microsoft-COFF" libraries - Note: AHX Replayer will ONLY work with C++ projects, not C! 3. Features ----------- - Plays all AHX 2.x-tunes (incl. filter, etc.) - Needs ~4% cpu-power (on P200MMX) - not optimized yet! - Easy to use 4. How to use it ---------------- 1. make a dir "AHX" in your include-directory and put both files AHX.h and Windows.h into it. 2. put the 2 libraries AHXrls.lib and AHXdbg.lib into your libs-directory. 3. In your project where you want to use the AHX replayer, do the following: a) You must use the "Multithreaded Runtime-library" (Build->Settings->C/C++->Code Generation) b) Build->Settings->Link->General: Now for the debug version of your project add "AHXdbg.lib" to the "Object/library modules", for the release version add "AHXrls.lib" and don't forget to add "winmm.lib". c) "#include " at the beginning of your source. 4. Now you should be able to call the AHX functions 5. Minimal example source ----------------- #include /* ... */ /* in your main() function or somewhere */ AHXPlayer Player; AHXWaveOut WaveOut; Player.Init(); Player.LoadSong("My cool AHX Tune.AHX"); Player.InitSubsong(0); WaveOut.Init(); WaveOut.StartBackgroundPlay(); WaveOut.Play(&Player); /* now do everything you want (e.g. msg processing) until you're finished */ WaveOut.Stop(); WaveOut.StopBackgroundPlay(); } This example should be sufficient if you just want to quickly play a tune.. however if you e.g. want to play 10 tunes, you better use this source, because AHXPlayer::Init() normally pre-calculates ~410kb of waveforms. /* ... */ AHXWaves Waves; // this generates the waves /* ... */ Player.Init(&Waves); // tells the player to use our own waves! Okay, now for some additional useful parameters: int AHXWaveOut::Init(int Frequency = 44100, int Bits = 16, int Frames = 2, int NrBlocks = 16, float Boost = 1.f); Frequency: This is the output (and mixing) frequency in Hz. Be sure you select a valid value. 44100 gives you the best output, but you can select a lower value, if you need to. Bits: The number of bits per sample. 16 should be okay for everyone, except those people whose soundcards don't support 16bit samples. In that case you should use 8. Note: Using 8 bits instead of 16 doesn't give you any noticable performance increase! Frames, Blocks: This specified the buffering used by the waveOut-player: The default values of (2, 16) create 16 buffers, each 2 frames long (2 frames = 40 ms), so it gives a total buffer length of 640 ms. When playing is first started, all 16 buffers are filled, and then each 40 ms, another buffer is being rendered. This prevents you from big "out-times" during your smooth demo effects. Those values should be okay for everyone, but you shouldn't expect to time your demo to a AHX tune, because there's quite a lot of latency. This maybe changed when I write a DirectSound-output. Boost: This specified an overall volume boost for the player. You should check your tune if it's loud enough, otherwise you can change that value to etc. 2.f or 4.f, just try it. Now for people, who may want to load a AHX tune into memory by themselves and let the AHXplayer get the tune from memory, No problem: int AHXPlayer::Load(void* Buffer, int Len); with Buffer = pointer to your AHX tune and Len = length of the AHX tune (in bytes) int AHXOutput::SetOption(int Option, int Value); int AHXOutput::SetOption(int Option, float Value); this sets specific options of the output class. Until now, only 2 are defined: AHXOI_OVERSAMPLING: 0 = no oversampling, 1 = standard oversampling all other values = reserved for future use! AHXOF_BOOST: set boost (like in Init()) the syntax of the options if: AHXO[I|F]_OPTION with I for options that take int values and f for float values. RETURN VALUES: -------------- have a look at the include files, all functions that return "int"s return 1 (TRUE) if successful, and 0 (FALSE) if failed! 6. Future --------- Hey, this has only been a short documentation! Anyway, have a look at the include-files. I'll write a better doc soon. You can also customize the output modules of the player, but I will tell you more about this in the next release. In the next release, I will also include the source of Windows.cpp module, to allow you easy customization of the output modules. 7. Ports -------- We're looking for skilled coders to port AHX Replayer to all kinds of machines/OSs (BeOS, MacOS, Linux, HP-UX, Irix, SunOS, WinCE, MS-DOS, ...) The sources are 100% C++ and you will receive them if you're qualified to do a port. 8. Credits ---------- Original AHX Concept: Pink/Abyss, Dexter/Abyss Original AHX Amiga ASM Player: Dexter/Abyss AHX C++/Win32 Player: Bartman/Abyss Audial Quality Control: Pink/Abyss Beta-Testers: Pink/Abyss, Crow/Abyss, Grace, freQvibeZ 9. Contacts ----------- Check the Abyss homepage at http://abyss.moving-people.net Check the AHX homepage at http://abyss.moving-people.net/ahxpc.html If you want to do a port of the AHX replayer, contact Bartman/Abyss at barto@gmx.net For all other people: NO THE SOURCE IS NOT AVAILABLE! NO THERE WILL BE NO .DLL! It's much bigger and a lot more compilcated to use NO THERE WILL BE NO DELPHI UNIT OR VISUAL BASIC ACTIVEX CONTROL! Go get a real compiler if you want to use this! It's meant to be for elite people only!