Decode G.723 in WAV format #600

Open
opened 2025-09-02 10:52:05 +00:00 by martinwguy · 0 comments
martinwguy commented 2025-09-02 10:52:05 +00:00 (Migrated from codeberg.org)

Decode G.723 encoding in WAV format

Description

src/wav.c currently only knows about G.610 (-e gsm-full-rate) encoding
but there are functions g723_{24,40}_decoder(), used by src/au.c.

In src/wav.c there are

#define WAVE_FORMAT_G721_ADPCM          (0x0040U)
#define WAVE_FORMAT_G728_CELP           (0x0041U)
#define WAVE_FORMAT_G726_ADPCM          (0x0064U)
#define WAVE_FORMAT_G722_ADPCM          (0x0065U)

but no value for bytes 21-22 ("Type of format") of the WAV file header
for WAVE_FORMAT_G723_ADPCM.

mingw32's include file mmreg.h has #define WAVE_FORMAT_* lines
whose names and values correspond to those in src/wav.c and includes

#define WAVE_FORMAT_G723_ADPCM 0x0014

as well as 265 others (!) so it should be relatively easy to decode it
(and maybe encode it too, see issue #598).

# Decode G.723 encoding in WAV format ## Description `src/wav.c` currently only knows about G.610 (`-e gsm-full-rate`) encoding but there are functions `g723_{24,40}_decoder()`, used by `src/au.c`. In `src/wav.c` there are ``` #define WAVE_FORMAT_G721_ADPCM (0x0040U) #define WAVE_FORMAT_G728_CELP (0x0041U) #define WAVE_FORMAT_G726_ADPCM (0x0064U) #define WAVE_FORMAT_G722_ADPCM (0x0065U) ``` but no value for bytes 21-22 ("Type of format") of the WAV file header for `WAVE_FORMAT_G723_ADPCM`. mingw32's include file `mmreg.h` has `#define WAVE_FORMAT_*` lines whose names and values correspond to those in `src/wav.c` and includes ``` #define WAVE_FORMAT_G723_ADPCM 0x0014 ``` as well as 265 others (!) so it should be relatively easy to decode it (and maybe encode it too, see issue #598).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
martinwguy/sox_ng#600
No description provided.