diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2008-09-10 19:48:45 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2008-09-10 19:48:45 +0000 |
commit | 5e976eec4b731070a2d04ff4eff54a0ad91926e7 (patch) | |
tree | 7d1d472a4a508f9c6546c25a3aa892b6523ef1fb /pjmedia/include | |
parent | 96311105ab80f66bab133b8083aad7dcdb9dee9e (diff) |
Ticket #614: Added support for writing and reading WAV files encoded as 8 bit A-law/U-law.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2270 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/include')
-rw-r--r-- | pjmedia/include/pjmedia/wav_port.h | 23 | ||||
-rw-r--r-- | pjmedia/include/pjmedia/wave.h | 17 |
2 files changed, 39 insertions, 1 deletions
diff --git a/pjmedia/include/pjmedia/wav_port.h b/pjmedia/include/pjmedia/wav_port.h index 4385e8fc..1e133f16 100644 --- a/pjmedia/include/pjmedia/wav_port.h +++ b/pjmedia/include/pjmedia/wav_port.h @@ -142,6 +142,27 @@ pjmedia_wav_player_set_eof_cb( pjmedia_port *port, */ +/** + * WAV file writer options. + */ +enum pjmedia_file_writer_option +{ + /** + * Tell the file writer to save the audio in PCM format. + */ + PJMEDIA_FILE_WRITE_PCM = 0, + + /** + * Tell the file writer to save the audio in G711 Alaw format. + */ + PJMEDIA_FILE_WRITE_ALAW = 1, + + /** + * Tell the file writer to save the audio in G711 Alaw format. + */ + PJMEDIA_FILE_WRITE_ULAW = 2, +}; + /** * Create a media port to record streams to a WAV file. Note that the port @@ -154,7 +175,7 @@ pjmedia_wav_player_set_eof_cb( pjmedia_port *port, * @param channel_count Number of channels. * @param samples_per_frame Number of samples per frame. * @param bits_per_sample Number of bits per sample (eg 16). - * @param flags Port creation flags (must be 0 at present). + * @param flags Port creation flags. * @param buff_size Buffer size to be allocated. If the value is * zero or negative, the port will use default buffer * size (which is about 4KB). diff --git a/pjmedia/include/pjmedia/wave.h b/pjmedia/include/pjmedia/wave.h index 508329a5..8e268e62 100644 --- a/pjmedia/include/pjmedia/wave.h +++ b/pjmedia/include/pjmedia/wave.h @@ -66,11 +66,27 @@ PJ_BEGIN_DECL */ #define PJMEDIA_DATA_TAG ('a'<<24|'t'<<16|'a'<<8|'d') +/** + * Standard FACT tag to identify fact chunks. + */ +#define PJMEDIA_FACT_TAG ('t'<<24|'c'<<16|'a'<<8|'f') + + +/** + * Enumeration of format compression tag. + */ +typedef enum { + PJMEDIA_WAVE_FMT_TAG_PCM = 1, + PJMEDIA_WAVE_FMT_TAG_ALAW = 6, + PJMEDIA_WAVE_FMT_TAG_ULAW = 7 +} pjmedia_wave_fmt_tag; + /** * This file describes the simpler/canonical version of a WAVE file. * It does not support the full RIFF format specification. */ +#pragma pack(2) struct pjmedia_wave_hdr { /** This structure describes RIFF WAVE file header */ @@ -98,6 +114,7 @@ struct pjmedia_wave_hdr pj_uint32_t len; /**< Data length. */ } data_hdr; }; +#pragma pack() /** * @see pjmedia_wave_hdr |