Codes collection

 

Sound volumn control sample code 

sound_oss_control.c

more detailed reference for oss programming:

http://www.oreilly.de/catalog/multil...pt/ch14-01.htm
tunning of all sorts of parameters (volumn, mic, etc.):
http://www.oreilly.de/catalog/multil...pt/ch14-07.htm
setup sampling rate, sampling time, mono or stereo sound, then record from mic and play the sound:
http://www.oreilly.de/catalog/multil...pt/ch14-05.htm
simpler example of recording from mic, and playing the sound:
http://www.oreilly.de/catalog/multil...pt/ch14-02.htm

sound volumn control using alsa:

sound_mixer_alsa.cc 

Realtime ray tracing 

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

Requirement: SDL 

rtraysdl.tar.bz2 

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. 

avcodec2.c 

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:

avcodec3.c  

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

xviddec1.c

Curved spaces:

The link to computer graphics in curved spaces:

http://geometrygames.org/CurvedSpaces/index.html

Anyone interested in porting it to linux c?


Publication

Software

Code Collection

Legged Robots

Global warming