Comparing Voice Coding
This is a Windows program (tested win32) to compare a few voice codecs.
This program was written some time ago, so these are all older codecs.
This .net program built for x86 requires .net 3.5. After selecting the desired codec in the centre column,
the program can either code a .wav file to a data file or uncode a datafile to a new .wav file.
(This gets a little complicated because the uncode function can create another .wav file..)
Contents of zip:
The .net program calls a .dll for the selected codec. The image above shows a bunch of (32 bit) .dll and the program
includes a crc32 file checker (for smaller files) to ensure the correct dlls are used with the program.
myelpe33.zip (most recent version)
By using 'Link' (or 'dumpbin'), the .dll can be inspected for exposed routines:
This however doesn't show the calling parameters. For the m800.dll, the source code declares each function to be exposed:
in m800.c
__declspec(dllexport) void __cdecl m800_i(void);
__declspec(dllexport) short __cdecl m800_a(unsigned char* buf, short* sp);
__declspec(dllexport) void __cdecl m800_s(short* sp, unsigned char* buf);
The .net program has to declare these functions too:
in .net
DllImport("m800") _
Private Sub m800_i()
End Sub
DllImport("m800") _
Private Function m800_a(<[In]()> ByVal bbuf() As Byte, <[Out]()> ByVal speech() As Short) As Short
End Function
DllImport("m800")_
Private Sub m800_s(<[In]()> ByVal speech() As Short, <[Out]()> ByVal bibuf() As Byte)
End Sub
some variables are needed in the .net program:
Dim vac As Integer ' voice activity flag
Dim sosiz As Integer = 540 ' speech
Dim disiz As Integer = 16 ' 81 bits buf
Dim local_speech(sosiz - 1) As Short
Dim demod_in(disiz) As Byte
and the simple code as follows;
then to initialse:
m800_i()
then to code local_speech to data (demod_in):
vac = m800_a(demod_in, local_speech) '//compress 540 samples sp -> 72 bits buf (90mS)
then to decode data (demod_in) back to speech:
m800_s(speech_back, demod_in) '; //decompress 72 bits buf -> 540 samples (90mS)
All of these codecs require input .wav at 16000 rate with the exception of the 800bps (m800.dll) that requires
input .wav at 12000 rate. A program can be found in the 'resampler' folder to accurately convert .wav files
from one rate to the other. The .net program expecting mono 16bit samples. This full trust.net program has no
FileIOPermission, so if run from Program Files, data and recordings might be saved to
C:\Users\username\AppData\Local\VirtualStore\Program Files