http://tovganesh.googlepages.com/s60
and let me know the feedback on the previous post on math library in symbian!

pow(), acos()
along with some advanced functions like lgamma()
.pow()
and acos()
seem to have some problem with handling very low values, which are typically less 1.0e-12
. So, using such functions with these low value resulted in crashing of the code (in this case the Python interpreter), with no apparent error message. To avert this problem I had to add a wrapper over the pow()
or acos()
function that reads some what like as follows:
def myacos(ang):
if(round(ang,1)==1.0): return 0.0
return acos(ang)
def mypow(self, x, y):
if (round(y,10)==0.0): return 1.0
if (round(x,10)==0.0): return 0.0
return pow(x, y)
double absd(double x) {
return (x<0.0 ? -x : x);
}
double mpow(double x, double y) {
if (absd(y)<=1.0e-10) return 1.0;
if (absd(x)<=1.0e-10) return 0.0;
return pow(x, y);
}
abs(y)
did not work, and the complier (Symbian SDK on Windows XP for s60 2nd edition) gave me an error indicating that abs()
takes an int
argument (possibly it took my code to be a pure C code)!! Anyways, I later on discovered that it is better to use fabs()
instead.round(), lgamma()
#~/bin/csh
mplayer -ao pcm "$1"
set quality = $2
if (null$quality == null) set quality = hi
if ($quality == lo) then
# useful for your mono phones (like 6600)
oggenc --downmix --resample 8000 -q 1 audiodump.wav
else
oggenc audiodump.wav
endif
mv audiodump.ogg "$1:t:r".ogg
rm -f audiodump.*