OS/2, eCS & ArcaOS - Technical > Multimedia
PC Speaker output to sound card?
Lars:
By now I have found out under what conditions my implementatiion of DosBeep will currently hang:
There is file SPI.INI in directory \MMOS2 that defines for each DATATYPE/SUBTYPE (this combination defines a triple of sampling rate,bit resolution, number of channels) how many buffers needs to be filled as a minimum and also the minimum size of each of those buffers.
I have now reworked NEWCALLS.DLL to play a sound with a minimum length that results out of those settings even if that is slightly longer than the requested duration (it is impossible for a human to notice a difference between 1 ms and 50 ms).
Find attached.
Lars:
A new update, now DOS16BEEP (the 16-bit counterpart of DosBeep) is also supported.
Lars:
Here is some test code and the build batch file building a 32-bit and also a 16-bit version of the test exe:
bla.c
--- Code: ---#define INCL_BASE
#include <os2.h>
#include <stdio.h>
int main(int argc,char *argv[])
{
printf("Hallo!\n");
DosBeep(800,1000);
return 0;
}
--- End code ---
the build batch file (adapt where necessary):
--- Code: ---@echo off
setlocal
echo Building 32-bit executable...
icc.exe -Q -Gm+ -Gd+ -Ge+ -G5 -Ti -C bla.c
ilink.std -NOL -DE -DB -M -E:2 -NOPACKC -BAS:0x10000 -ST:0x8000 -PM:VIO -O:bla.exe bla.obj
dllrname.exe /Q /N bla.exe CPPOM30=OS2OM30 DOSCALLS=NEWCALLS
echo Building 16-bit executable...
SET PATH=d:\ddk\base\tools;%PATH%
SET INCLUDE=d:\ddk\base\h
SET LIB=d:\ddk\base\lib
cl.exe /nologo /AS /Od /G2 /Zi /Zl /c bla.c
link.exe /NOL /BATCH /CO /NOD /MAP /EXE /ST:0x8000 /PM:VIO bla.obj,bla16.exe,,os2286.lib+slibcep.lib;
dllrname.exe /Q /N bla16.exe DOSCALLS=NEWCALLS
endlocal
--- End code ---
Martin Iturbide:
Hi Lars
I found this sample awesome. What do you think if we document your sample like the attached package?
I just consolidated the things on the thread on the readme.
Regards
Lars:
Need to brush up everything once more.
But sure, document as you like. I can also put this stuff on Hobbes if wanted.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version