diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2008-06-12 12:48:59 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2008-06-12 12:48:59 +0000 |
commit | 5982a41faa033f0eb4e61ce93489ea886879080f (patch) | |
tree | ba8505c8ae5942bc3bdc3854c98bfa279c6a4099 /pjmedia/include/pjmedia/sound.h | |
parent | f6f83a2e0b506167a560b374bcd5a781c10a7348 (diff) |
Ticket #542: added new API and macro for sound device latency settings, also added new param for this in pjsua
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2007 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/include/pjmedia/sound.h')
-rw-r--r-- | pjmedia/include/pjmedia/sound.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/pjmedia/include/pjmedia/sound.h b/pjmedia/include/pjmedia/sound.h index 91d1cb8f..ca9ccee4 100644 --- a/pjmedia/include/pjmedia/sound.h +++ b/pjmedia/include/pjmedia/sound.h @@ -154,6 +154,28 @@ PJ_DECL(const pjmedia_snd_dev_info*) pjmedia_snd_get_dev_info(unsigned index); /** + * Set sound device latency, this function must be called before sound device + * opened, or otherwise default latency setting will be used, @see + * PJMEDIA_SND_DEFAULT_REC_LATENCY & PJMEDIA_SND_DEFAULT_PLAY_LATENCY. + * + * Choosing latency value is not straightforward, it should accomodate both + * minimum latency and stability. Lower latency tends to cause sound device + * less reliable (producing audio dropouts) on CPU load disturbance. Moreover, + * the best latency setting may vary based on many aspects, e.g: sound card, + * CPU, OS, kernel, etc. + * + * @param input_latency The latency of input device, in ms, set to 0 + * for default PJMEDIA_SND_DEFAULT_REC_LATENCY. + * @param output_latency The latency of output device, in ms, set to 0 + * for default PJMEDIA_SND_DEFAULT_PLAY_LATENCY. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjmedia_snd_set_latency(unsigned input_latency, + unsigned output_latency); + + +/** * Create sound stream for both capturing audio and audio playback, from the * same device. This is the recommended way to create simultaneous recorder * and player streams (instead of creating separate capture and playback |