Hi everyone,
I need a bit of advice. It's about recording a mono audio source with telephone quality, i.e. the recorded file should be as small as possible.
Console application, Win XP-32, Lazarus v1.4.4, FPC 2.6.4
Here is the code sample:
i:=uos_loadlib(pchar('C:\sndlib\libPortaudio-32.dll'),
nil,
nil,
nil,
pchar('C:\sndlib\LibFaad2-32.dll'));
plidx:=0;
uos_CreatePlayer(plidx); sleep(500);
i:=uos_addIntoFile(plidx,pchar('C:\snd.wav'),8000,2,2,65536); sleep(500);
inidx:=uos_AddFromDevIn(plidx,-1,-1,8000,2,-1,2,4096); sleep(500);
uos_play(plidx);
sleep(10000);
uos_stop(plidx);
sleep(500);
uos_unloadlib;
As can be seen, I reduced the sampling rate to 8000.
This gives good results with a file size of 305kbyte for a 10sec record.
But when I set the parameters to 'MONO' the recorded audio file becomes unintelligible and it's duration is only half of the recording periode.
So if anyone can direct me to the correct settings to record voice (mono) in telephone quality with minimum filesize, I would highly appreciate it.
But if it's not possible I can bear it to have the record in stereo, no problem as such.
Finally, UOS is a great peace of code, thanks to the authors.
Kind regards
Chris