CMSV6Help Center
/
839 DOCS · 213 VIDEOS中文

Audio format docking

Author 谢周轩Updated 2025-10-16 14:55:17Doc ID 2379400 words · 2 min readView original ↗

1. function description

Real- time video, monitor, intercom audio format configuration instructions

2. Docking instructions

2.1 if all channels of the device have the same audio format

/very/** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** *
* @ media type definition
* @ Audio type defaults to TTX_AUDIO_TYPE_G726_40KBPS
* @ audio channel nAudioChannel defaults to 1
* @ Audio sample rate nAudioSamplesPerSec defaults to 8000
* @ The number of bits required for each audio sample, the default is 16
* @ Information frame decoder type, used in vehicle terminals, mainly used to parse GPS and vehicle status data
Wash ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **/
LIBDVRNET_API int TTXNET_SetMediaInfo(int nAudioType, int nAudioChannel, int nAudioSamplesPerSec, int nAudioBitPerSamples, int nVideoCoder = TTX_VIDEO_CODEC_H264);

When initializing, just call the TTXNET_SetMediaInfo directly to configure the audio format.

2.2 Different audio formats for different channels

/very/ ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** *
// Get the audio encoding format
// @ nChannel: channel number starts from 0
// @ nAudioStreamType: TTX_AUDIO_STREAM_MIC or TTX_AUDIO_STREAM_CAM, TTX_AUDIO_STREAM_MIC for intercom
// @ nAudioCoder: audio type TTX_AUDIO_TYPE_G726, etc.
// If the audio formats of different channels are different, for example, g711 is used for intercom and aac is used for video, please reload some interfaces
// The TTXNET_SetMediaInfo interface is configured with the audio format used by the platform intercom.
// If it is the same audio format, you do not need to overload the GetAudioParam interface
Wash ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
/
virtual bool GetAudioParam(int nChannel, int nAudioStreamType, int& nAudioCoder) { return false;}

overload virtual bool GetAudioParam(int nChannel, int nAudioStreamType, int & nAudioCoder) { return false; }
Returns audio in different formats

Source help.cmsv7.com
839 documents · 213 videos · docs.alwaycare.com