News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Dial Up Modem sound

Started by hfheatherfox07, January 05, 2013, 06:54:04 AM

Previous topic - Next topic

hfheatherfox07

Have you seen the example by  William F. Cravener 5/27/2003  ?
Plays an mid you select .... Doesn't that have to buffer it some where to achieve that ? 
Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.

dedndave

file mapping - that's a thought   :P

hfheatherfox07

I have an example that plays an xm.inc file when you do it that way ... you play from memory

So instead of:
invoke uFMOD_PlaySong,400,hInstance,XM_RESOURCE

you use:
INVOKE uFMOD_PlaySong,addr table,XMSize,XM_MEMORY

Would that help you in anyway ? both .xm and .mid use ufmod.lib and I have the asm for that
Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.

dedndave

well - i would rather learn how to do it without someone's library   :P

i think this is the answer...
QuoteApplications that access memory buffers to store and access MIDI data can use the memory
I/O features of the multimedia input/output (MMIO) file services. This technique consists of
opening a memory file using mmioOpen. mmioOpen has a pointer to the buffer of MIDI data
as a parameter. This buffer can then be operated on by MCI and MMIO as if it were a file.

http://www.warpspeed.com.au/cgi-bin/inf2html.cmd?..\html\book\Toolkt40\MMAPG.INF+90

i'll play with it more, when i have some time

dedndave

that could also be the answer to the vista beep issue   :P

dedndave

i think i almost have this figured out
one line of C code is giving me trouble   :P
Quote{
   /* variable for IOProc */
   PMMIOPROC  pIOProc;
   HMODULE    hModMidiio;

   /* variables for memory file */
   MMIOINFO  mmioInfo;
   CHAR      UserBuffer[SIZE_OF_BUFFER];
   HMMIO     hmmio;

   /* variables for MCI commands */
   MCI_OPEN_PARMS  mop;
   MCI_PLAY_PARMS  mpp;

   /* Open memory file. Provide MIDI-filled data buffer to MMIO, so
    * data buffer becomes file image in memory.  Also specify that
    * the data will need to be translated.
    */

mmioInfo.pchBuffer = UserBuffer; /* Filled with untranslated
                                     MIDI data                */
mmioInfo.cchBuffer = SIZE_OF_BUFFER; /* User-defined         */
mmioInfo.ulTranslate = MMIO_TRANSLATEDATA | MMIO_TRANSLATEHEADER;
                                 /* Need to translate data    */
mmioInfo.fccIOProc = mmioFOURCC( 'M', 'I', 'D', 'I');/* Data
                                                          format */
mmioMemInfo.fccChildIOProc = FOURCC_MEM;        /* Storage type */
hmmio = mmioOpen ( NULL, mmioInfo, MMIO_READWRITE );

    /* open MIDI device */

    mop.pszElementName = (PSZ) hmmiomem;

    mciSendCommand(
         0,                        /* We don't know the device yet. */
         MCI_OPEN,                 /* MCI message                   */
         MCI_WAIT | MCI_OPEN_MMIO |
         MCI_OPEN_TYPE_ID | MCI_OPEN_SHAREABLE,
         (ULONG) &mop,         /* Parameters for the message    */
         0 );                      /* Parameter for notify message  */

    /* play MIDI memory file for 1 second */

    mpp.ulFrom=0;
    mpp.ulTo=3000;    /* default is MMTIME units (1/3000 second) */
    mciSendCommand(
            mop.usDeviceID,        /* Device to play the data    */
            MCI_PLAY,              /* MCI message                */
            MCI_WAIT |
            MCI_FROM | MCI_TO,     /* Flags   for   the   MCI   message    * /
              ( ULONG )   &mpp ,            / *   Parameters   for   the   message   * /
              0   ) ;                      / *   No   parm   necessary            * /

      / *   close   device   * /

      mciSendCommand (
              mop . usDeviceID ,          / *   Device   to   play   this            * /
              MCI _ CLOSE ,                / *   MCI   message                     * /
              MCI _ WAIT ,                 / *   Flags   for   the   MCI   message      * /
              ( ULONG )   NULL ,            / *   Parameters   for   the   message     * /
              ( ULONG )   NULL   ) ;          / *   Parameter   for   notify   message   * /

}
(PSZ) hmmiomem
PSZ sounds like a pointer to a zero terminated something
hmmiomem sounds like a handle

i don't think this code was ever tested   :P
i also think it was written for OS/2 - lol

hfheatherfox07

Well I wont pretend to understand it but if you look at the playwav.cpp here :
http://www.pudn.com/downloads159/sourcecode/multimedia/mpeg/detail708927.html
Here is the README.1ST : http://read.pudn.com/downloads159/sourcecode/multimedia/mpeg/708927/README.1ST__.htm
you will see what is needed ....
Command-line parameters -p, -n, -t, -b are specific for OS/2 - use them!

You should have OS/2 Warp with MMPM installed supported DART and an audio card
capable of 44.1kHz 16 bit output.


Here is the file in case it helps  :(

This actually was tested and been around since 02.12.97 ( at least when the file was uploaded lol)

mapl2135.ZIP  MaPlay for OS/2 (maplay/2) version 1.3.5. MaPlay is a mpeg audio player.
Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.

dedndave

yah - that's for OS/2, as well - lol
i may be able to make this work if i play with the flags
i will work on it, later   :P

dedndave

i think i figured out what "(PSZ) hmmiomem" means
they had to type the handle as a pointer to a null-terminated string in order to put it in the structure   :P

the code is for OS/2
which is why the mciSendCommand function has 5 parameters, instead of 4
the last parm can be discarded
they moved that into the structure(s)

so - that leaves me with flags to play with - some of them may not apply for win32

dedndave

i think we can scrap that method - lol
there are just too many differences between OS/2 and win32, when it comes to mci functions

but - i still think there's a way to do it
there are a lot of functions in there that don't seem to be well understood
it's a matter of taking the time to figure out how they all work - lol

i see it as a lot of unexplored territory
programmers find other ways to do it - and don't explore further