Codes collection


Sound volumn control sample code 


more detailed reference for oss programming:
tunning of all sorts of parameters (volumn, mic, etc.):
setup sampling rate, sampling time, mono or stereo sound, then record from mic and play the sound:
simpler example of recording from mic, and playing the sound:

sound volumn control using alsa: 

Realtime ray tracing 

A realtime ray tracing program written in Pascal by someone, I ported it to linux c.

Requirement: SDL 


Compile: gcc rtray_sdl.c -o rtray_sdl -lSDL

Using ffmpeg library to decord video

ffmpeg is an important library used by many linux media players such as the well known mplayer, but the online documents for newbies to use this lib for programming purposes are few. Fortunately, Martin Böhme wrote an example (and update), which can be compiled under version 0.4.9 of ffmpeg, but some variable definitions have been changed since the cvs version next to 0.4.9, which render it fail to work. To deal with the problem, I altered the orginal file. Also, some displaying code was added to make it capable of playing media. 


Next, I give a more complicated example, capable of handling frame rate control, frame seeking etc., I draw most of the ideas from the file ffplay.c of ffmpeg:


Using xvid library to decord video

Requirement:xvidcore-1.1.0. Is there no seeking control function for xvid? The displaying code comes from realtang


Curved spaces:

The link to computer graphics in curved spaces:

Anyone interested in porting it to linux c?



Code Collection

Legged Robots

Global warming