How to convert Dialogic .vox to .wav using c# or vb
-
Can any one help, How to convert Dialogic .vox to .wav file using c# or vb. I have dialog vox file,I need to convert Dialogic .vox to .wav file using c# or vb. Below code using convert ADPCM Vox to Wav but my requirement is Dialogic .vox to .wav
Module moduleVOX2WAV
Dim WaveHeader() As Int32 = New Int32() {&H46464952, &HFFFFFFDB, &H45564157, &H20746D66, 16, &H10001, 6000, 12000, &H100002, &H61746164, -1} Dim IndexShift() As Int16 = New Int16() {-1, -1, -1, -1, 2, 4, 6, 8} Dim StepSize() As Int16 = New Int16() {16, 17, 19, 21, 23, 25, 28, 31, 34, 37, 41, 45, 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, 130, 143, 157, 173, 190, 209, 230, 253, 279, 307, 337, 371, 408, 449, 494, 544, 598, 658, 724, 796, 876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358, 5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794} Dim Nibble2Bit(,) As Int16 = New Int16(,) {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 1, 0}, {0, 0, 1, 1}, {0, 1, 0, 0}, {0, 1, 0, 1}, {0, 1, 1, 0}, {0, 1, 1, 1}, {1, 0, 0, 0}, {1, 0, 0, 1}, {1, 0, 1, 0}, {1, 0, 1, 1}, {1, 1, 0, 0}, {1, 1, 0, 1}, {1, 1, 1, 0}, {1, 1, 1, 1}} Dim SignTable() As Int16 = New Int16() {1, -1} Dim StepSizeIndex As Int16 = 0 Dim Signal As Int16 = -2 Dim AvgBuffer() As Int16 = New Int16() {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} Dim AvgIndex As Int16 = 0 Dim Total As Int32 = 0 Dim Length As Int32 Dim Offset As Int32 Dim nibble As Int16 Dim ReadBuffer(4096) As Byte Dim WriteBuffer(8192) As Int16 Public Sub Convert(ByVal srcVOXFile As String, ByVal destWAVFile As String) Dim strm As New IO.FileStream(srcVOXFile, IO.FileMode.Open, IO.FileAccess.Read) FileOpen(2, destWAVFile, OpenMode.Binary, OpenAccess.Write, OpenShare.LockWrite) FilePut(2, WaveHeader) Length = 4096 While Length = 4096 Length = strm.Read(ReadBuffer, 0, 4096) For Offset = 0 To Length - 1 nibble = 0 Signal
-
Can any one help, How to convert Dialogic .vox to .wav file using c# or vb. I have dialog vox file,I need to convert Dialogic .vox to .wav file using c# or vb. Below code using convert ADPCM Vox to Wav but my requirement is Dialogic .vox to .wav
Module moduleVOX2WAV
Dim WaveHeader() As Int32 = New Int32() {&H46464952, &HFFFFFFDB, &H45564157, &H20746D66, 16, &H10001, 6000, 12000, &H100002, &H61746164, -1} Dim IndexShift() As Int16 = New Int16() {-1, -1, -1, -1, 2, 4, 6, 8} Dim StepSize() As Int16 = New Int16() {16, 17, 19, 21, 23, 25, 28, 31, 34, 37, 41, 45, 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, 130, 143, 157, 173, 190, 209, 230, 253, 279, 307, 337, 371, 408, 449, 494, 544, 598, 658, 724, 796, 876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358, 5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794} Dim Nibble2Bit(,) As Int16 = New Int16(,) {{0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 1, 0}, {0, 0, 1, 1}, {0, 1, 0, 0}, {0, 1, 0, 1}, {0, 1, 1, 0}, {0, 1, 1, 1}, {1, 0, 0, 0}, {1, 0, 0, 1}, {1, 0, 1, 0}, {1, 0, 1, 1}, {1, 1, 0, 0}, {1, 1, 0, 1}, {1, 1, 1, 0}, {1, 1, 1, 1}} Dim SignTable() As Int16 = New Int16() {1, -1} Dim StepSizeIndex As Int16 = 0 Dim Signal As Int16 = -2 Dim AvgBuffer() As Int16 = New Int16() {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} Dim AvgIndex As Int16 = 0 Dim Total As Int32 = 0 Dim Length As Int32 Dim Offset As Int32 Dim nibble As Int16 Dim ReadBuffer(4096) As Byte Dim WriteBuffer(8192) As Int16 Public Sub Convert(ByVal srcVOXFile As String, ByVal destWAVFile As String) Dim strm As New IO.FileStream(srcVOXFile, IO.FileMode.Open, IO.FileAccess.Read) FileOpen(2, destWAVFile, OpenMode.Binary, OpenAccess.Write, OpenShare.LockWrite) FilePut(2, WaveHeader) Length = 4096 While Length = 4096 Length = strm.Read(ReadBuffer, 0, 4096) For Offset = 0 To Length - 1 nibble = 0 Signal
This is reading a specific file format. You need to know your other file format and write similar code that knows how to read it.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.