Re: [Seed7-users] Basic sound playing capabilities?
Interpreter and compiler for the Seed7 programming language.
Brought to you by:
thomas_mertes
From: Thomas M. <tho...@gm...> - 2021-11-20 08:09:41
|
Hi Cleverson, with sound you hit an interesting area. As you already found out the standard lib does not implement sound. I planned to do a sound lib, but up to now I did not take the time to implement it. The lunar lander (see: http://seed7.sourceforge.net/scrshots/lander.htm ) has something prepared to send frequencies and durations to some sound system. I have some questions: Which sound API functions from Windows do you want to use? Is there a similar sound API under Linux or other Unix systems? Could a combined Windows/Linux sound API be created from it? Seed7 tries to achieve portability between operating systems. For that reason direct calls from an application program to OS API functions are not desireable. To support portability something needs to balance the differences. In the end driver libraries for Windows and Linux (UNIX, BSD, MacOS) would be needed. That said nothing hinders you to write something for Windows. In the Seed7 manual there is a chapter about the foreign function interface (see: http://seed7.sourceforge.net/manual/ffi.htm ). In the first moment this looks complicated, but is not so complicated as it seems. Having sound for Windows could be a starting point. And it would be great if the same API can be supported from Linux in the future. I suggest using a file named snd_win.c for the Windows sound driver. The Linux/Unix one could use the name snd_unx.c. The common header for both APIs would be in snd_drv.h. Please be patient since I have no idea how a sound API looks today. Greetings Thomas |