Waitrud Weber’s blog

things and reminders for memories

3d: music: WindowsAPI: windows-make: it sounds wave files well.

We can put the sound-lootin in cg_schema.
We can sound the wave file in this interface.

download:

(image)

f:id:Waitrud_Weber:20210726062105p:plain

if you press "b", it sounds well.

 Debug console is necessary for this compilation with wimm.dll.

(20210727)
Creating a system wave is very important or not.
Microsoft WindowsAPI effectively sounds a wave file well even in some times and many times.
But limited times, when it tries to sound it.
It doesn't sound at the same time.
So, we can use mixing sounds calculation and operation.

> c:\aaa\bin\make.exe all
mingw32-g++ -Wall -O3 -I C:\MinGW\include\ -L C:\MinGW\lib -lgdi32 -lws2_32 -lwsock32 -lwinmm -mwindows -o wavewriter.o
-c wavewriter.cpp
wavewriter.cpp: In function 'void WriteWaveData()':
wavewriter.cpp:37:20: warning: 'pFormat' is used uninitialized in this function [-Wuninitialized]
if (waveOutOpen*1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
wavewriter.cpp:45:29: warning: 'hFormat' may be used uninitialized in this function [-Wmaybe-uninitialized]
LocalUnlock(hFormat);
^
wavewriter.cpp:47:28: warning: 'hmmio' may be used uninitialized in this function [-Wmaybe-uninitialized]
mmioClose(hmmio, 0);
^
wavewriter.cpp:53:24: warning: 'dwDataSize' may be used uninitialized in this function [-Wmaybe-uninitialized]
hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, dwDataSize );
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mingw32-g++ array_counter.o wTextarea.o wButton.o button.o winmain_001.o wButtonController.o clipboard.o something_word.
o wController.o wTextareaController.o thread_print.o client.o vCalculation.o vPoint.o vTriangle.o vIntersection.o vModel
.o vScreen.o display_threeD.o wEvent.o wEvent.o wCanvasController.o vLine.o Print.o list_directory.o parse.o numbering.o
sender.o wJavaStructure.o wMethod.o vPointStructure.o vPointLinear.o w3DInfo.o w3DCalculation.o wEventListener.o v3dCal
culation.o cg_schema.o vCuttingPlane.o vUtil.o wavesounds.o wavewriter.o -Wall -O3 -I C:\MinGW\include\ -L C:\MinGW\lib
-lgdi32 -lws2_32 -lwsock32 -lwinmm -mwindows -o winmain_001.exe

*1:LPHWAVEOUT)&hWaveOut, WAVE_MAPPER,
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// (LPWAVEFORMAT)pFormat,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(LPWAVEFORMATEX)pFormat,
~~~~~~~~~~~~~~~~~~~~~~~~
(LONG)hwndApp, 0L, CALLBACK_WINDOW