Blame include/freerdp/codec/audio.h

Packit 1fb8d4
/**
Packit 1fb8d4
 * FreeRDP: A Remote Desktop Protocol Implementation
Packit 1fb8d4
 * Audio Formats
Packit 1fb8d4
 *
Packit 1fb8d4
 * Copyright 2013 Marc-Andre Moreau <marcandre.moreau@gmail.com>
Packit 1fb8d4
 *
Packit 1fb8d4
 * Licensed under the Apache License, Version 2.0 (the "License");
Packit 1fb8d4
 * you may not use this file except in compliance with the License.
Packit 1fb8d4
 * You may obtain a copy of the License at
Packit 1fb8d4
 *
Packit 1fb8d4
 *     http://www.apache.org/licenses/LICENSE-2.0
Packit 1fb8d4
 *
Packit 1fb8d4
 * Unless required by applicable law or agreed to in writing, software
Packit 1fb8d4
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit 1fb8d4
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 1fb8d4
 * See the License for the specific language governing permissions and
Packit 1fb8d4
 * limitations under the License.
Packit 1fb8d4
 */
Packit 1fb8d4
Packit 1fb8d4
#ifndef FREERDP_CODEC_AUDIO_H
Packit 1fb8d4
#define FREERDP_CODEC_AUDIO_H
Packit 1fb8d4
Packit 1fb8d4
#include <winpr/wlog.h>
Packit 1fb8d4
Packit 1fb8d4
#include <freerdp/api.h>
Packit 1fb8d4
#include <freerdp/types.h>
Packit 1fb8d4
Packit 1fb8d4
#ifdef _WIN32
Packit 1fb8d4
#include <mmreg.h>
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
struct AUDIO_FORMAT
Packit 1fb8d4
{
Packit 1fb8d4
	UINT16 wFormatTag;
Packit 1fb8d4
	UINT16 nChannels;
Packit 1fb8d4
	UINT32 nSamplesPerSec;
Packit 1fb8d4
	UINT32 nAvgBytesPerSec;
Packit 1fb8d4
	UINT16 nBlockAlign;
Packit 1fb8d4
	UINT16 wBitsPerSample;
Packit 1fb8d4
	UINT16 cbSize;
Packit 1fb8d4
	BYTE* data;
Packit 1fb8d4
};
Packit 1fb8d4
typedef struct AUDIO_FORMAT AUDIO_FORMAT;
Packit 1fb8d4
Packit Service 5a9772
#define SNDC_CLOSE 1
Packit Service 5a9772
#define SNDC_WAVE 2
Packit Service 5a9772
#define SNDC_SETVOLUME 3
Packit Service 5a9772
#define SNDC_SETPITCH 4
Packit Service 5a9772
#define SNDC_WAVECONFIRM 5
Packit Service 5a9772
#define SNDC_TRAINING 6
Packit Service 5a9772
#define SNDC_FORMATS 7
Packit Service 5a9772
#define SNDC_CRYPTKEY 8
Packit Service 5a9772
#define SNDC_WAVEENCRYPT 9
Packit Service 5a9772
#define SNDC_UDPWAVE 10
Packit Service 5a9772
#define SNDC_UDPWAVELAST 11
Packit Service 5a9772
#define SNDC_QUALITYMODE 12
Packit Service 5a9772
#define SNDC_WAVE2 13
Packit Service 5a9772
Packit Service 5a9772
#define TSSNDCAPS_ALIVE 1
Packit Service 5a9772
#define TSSNDCAPS_VOLUME 2
Packit Service 5a9772
#define TSSNDCAPS_PITCH 4
Packit Service 5a9772
Packit Service 5a9772
#define DYNAMIC_QUALITY 0x0000
Packit Service 5a9772
#define MEDIUM_QUALITY 0x0001
Packit Service 5a9772
#define HIGH_QUALITY 0x0002
Packit 1fb8d4
Packit 1fb8d4
/*
Packit 1fb8d4
 * Format Tags:
Packit 1fb8d4
 * http://tools.ietf.org/html/rfc2361
Packit 1fb8d4
 */
Packit 1fb8d4
Packit Service 5a9772
#define WAVE_FORMAT_UNKNOWN 0x0000
Packit 1fb8d4
Packit 1fb8d4
#ifndef WAVE_FORMAT_PCM
Packit Service 5a9772
#define WAVE_FORMAT_PCM 0x0001
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit Service 5a9772
#define WAVE_FORMAT_ADPCM 0x0002
Packit Service 5a9772
#define WAVE_FORMAT_IEEE_FLOAT 0x0003
Packit Service 5a9772
#define WAVE_FORMAT_VSELP 0x0004
Packit Service 5a9772
#define WAVE_FORMAT_IBM_CVSD 0x0005
Packit Service 5a9772
#define WAVE_FORMAT_ALAW 0x0006
Packit Service 5a9772
#define WAVE_FORMAT_MULAW 0x0007
Packit Service 5a9772
#define WAVE_FORMAT_OKI_ADPCM 0x0010
Packit Service 5a9772
#define WAVE_FORMAT_DVI_ADPCM 0x0011
Packit Service 5a9772
#define WAVE_FORMAT_MEDIASPACE_ADPCM 0x0012
Packit Service 5a9772
#define WAVE_FORMAT_SIERRA_ADPCM 0x0013
Packit Service 5a9772
#define WAVE_FORMAT_G723_ADPCM 0x0014
Packit Service 5a9772
#define WAVE_FORMAT_DIGISTD 0x0015
Packit Service 5a9772
#define WAVE_FORMAT_DIGIFIX 0x0016
Packit Service 5a9772
#define WAVE_FORMAT_DIALOGIC_OKI_ADPCM 0x0017
Packit Service 5a9772
#define WAVE_FORMAT_MEDIAVISION_ADPCM 0x0018
Packit Service 5a9772
#define WAVE_FORMAT_CU_CODEC 0x0019
Packit Service 5a9772
#define WAVE_FORMAT_YAMAHA_ADPCM 0x0020
Packit Service 5a9772
#define WAVE_FORMAT_SONARC 0x0021
Packit Service 5a9772
#define WAVE_FORMAT_DSPGROUP_TRUESPEECH 0x0022
Packit Service 5a9772
#define WAVE_FORMAT_ECHOSC1 0x0023
Packit Service 5a9772
#define WAVE_FORMAT_AUDIOFILE_AF36 0x0024
Packit Service 5a9772
#define WAVE_FORMAT_APTX 0x0025
Packit Service 5a9772
#define WAVE_FORMAT_AUDIOFILE_AF10 0x0026
Packit Service 5a9772
#define WAVE_FORMAT_PROSODY_1612 0x0027
Packit Service 5a9772
#define WAVE_FORMAT_LRC 0x0028
Packit Service 5a9772
#define WAVE_FORMAT_DOLBY_AC2 0x0030
Packit Service 5a9772
#define WAVE_FORMAT_GSM610 0x0031
Packit Service 5a9772
#define WAVE_FORMAT_MSNAUDIO 0x0032
Packit Service 5a9772
#define WAVE_FORMAT_ANTEX_ADPCME 0x0033
Packit Service 5a9772
#define WAVE_FORMAT_CONTROL_RES_VQLPC 0x0034
Packit Service 5a9772
#define WAVE_FORMAT_DIGIREAL 0x0035
Packit Service 5a9772
#define WAVE_FORMAT_DIGIADPCM 0x0036
Packit Service 5a9772
#define WAVE_FORMAT_CONTROL_RES_CR10 0x0037
Packit Service 5a9772
#define WAVE_FORMAT_NMS_VBXADPCM 0x0038
Packit Service 5a9772
#define WAVE_FORMAT_ROLAND_RDAC 0x0039
Packit Service 5a9772
#define WAVE_FORMAT_ECHOSC3 0x003A
Packit Service 5a9772
#define WAVE_FORMAT_ROCKWELL_ADPCM 0x003B
Packit Service 5a9772
#define WAVE_FORMAT_ROCKWELL_DIGITALK 0x003C
Packit Service 5a9772
#define WAVE_FORMAT_XEBEC 0x003D
Packit Service 5a9772
#define WAVE_FORMAT_G721_ADPCM 0x0040
Packit Service 5a9772
#define WAVE_FORMAT_G728_CELP 0x0041
Packit Service 5a9772
#define WAVE_FORMAT_MSG723 0x0042
Packit Service 5a9772
#define WAVE_FORMAT_MPEG 0x0050
Packit Service 5a9772
#define WAVE_FORMAT_RT24 0x0052
Packit Service 5a9772
#define WAVE_FORMAT_PAC 0x0053
Packit 1fb8d4
Packit 1fb8d4
#ifndef WAVE_FORMAT_MPEGLAYER3
Packit Service 5a9772
#define WAVE_FORMAT_MPEGLAYER3 0x0055
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit Service 5a9772
#define WAVE_FORMAT_LUCENT_G723 0x0059
Packit Service 5a9772
#define WAVE_FORMAT_CIRRUS 0x0060
Packit Service 5a9772
#define WAVE_FORMAT_ESPCM 0x0061
Packit Service 5a9772
#define WAVE_FORMAT_VOXWARE 0x0062
Packit Service 5a9772
#define WAVE_FORMAT_CANOPUS_ATRAC 0x0063
Packit Service 5a9772
#define WAVE_FORMAT_G726_ADPCM 0x0064
Packit Service 5a9772
#define WAVE_FORMAT_G722_ADPCM 0x0065
Packit Service 5a9772
#define WAVE_FORMAT_DSAT 0x0066
Packit Service 5a9772
#define WAVE_FORMAT_DSAT_DISPLAY 0x0067
Packit Service 5a9772
#define WAVE_FORMAT_VOXWARE_BYTE_ALIGNED 0x0069
Packit Service 5a9772
#define WAVE_FORMAT_VOXWARE_AC8 0x0070
Packit Service 5a9772
#define WAVE_FORMAT_VOXWARE_AC10 0x0071
Packit Service 5a9772
#define WAVE_FORMAT_VOXWARE_AC16 0x0072
Packit Service 5a9772
#define WAVE_FORMAT_VOXWARE_AC20 0x0073
Packit Service 5a9772
#define WAVE_FORMAT_VOXWARE_RT24 0x0074
Packit Service 5a9772
#define WAVE_FORMAT_VOXWARE_RT29 0x0075
Packit Service 5a9772
#define WAVE_FORMAT_VOXWARE_RT29HW 0x0076
Packit Service 5a9772
#define WAVE_FORMAT_VOXWARE_VR12 0x0077
Packit Service 5a9772
#define WAVE_FORMAT_VOXWARE_VR18 0x0078
Packit Service 5a9772
#define WAVE_FORMAT_VOXWARE_TQ40 0x0079
Packit Service 5a9772
#define WAVE_FORMAT_SOFTSOUND 0x0080
Packit Service 5a9772
#define WAVE_FORMAT_VOXWARE_TQ60 0x0081
Packit Service 5a9772
#define WAVE_FORMAT_MSRT24 0x0082
Packit Service 5a9772
#define WAVE_FORMAT_G729A 0x0083
Packit Service 5a9772
#define WAVE_FORMAT_MVI_MV12 0x0084
Packit Service 5a9772
#define WAVE_FORMAT_DF_G726 0x0085
Packit Service 5a9772
#define WAVE_FORMAT_DF_GSM610 0x0086
Packit Service 5a9772
#define WAVE_FORMAT_ISIAUDIO 0x0088
Packit Service 5a9772
#define WAVE_FORMAT_ONLIVE 0x0089
Packit Service 5a9772
#define WAVE_FORMAT_SBC24 0x0091
Packit Service 5a9772
#define WAVE_FORMAT_DOLBY_AC3_SPDIF 0x0092
Packit Service 5a9772
#define WAVE_FORMAT_ZYXEL_ADPCM 0x0097
Packit Service 5a9772
#define WAVE_FORMAT_PHILIPS_LPCBB 0x0098
Packit Service 5a9772
#define WAVE_FORMAT_PACKED 0x0099
Packit Service 5a9772
#define WAVE_FORMAT_RHETOREX_ADPCM 0x0100
Packit Service 5a9772
#define WAVE_FORMAT_IRAT 0x0101
Packit Service 5a9772
#define WAVE_FORMAT_VIVO_G723 0x0111
Packit Service 5a9772
#define WAVE_FORMAT_VIVO_SIREN 0x0112
Packit Service 5a9772
#define WAVE_FORMAT_DIGITAL_G723 0x0123
Packit Service 5a9772
#define WAVE_FORMAT_WMAUDIO2 0x0161
Packit Service 5a9772
#define WAVE_FORMAT_WMAUDIO3 0x0162
Packit Service 5a9772
#define WAVE_FORMAT_WMAUDIO_LOSSLESS 0x0163
Packit Service 5a9772
#define WAVE_FORMAT_CREATIVE_ADPCM 0x0200
Packit Service 5a9772
#define WAVE_FORMAT_CREATIVE_FASTSPEECH8 0x0202
Packit Service 5a9772
#define WAVE_FORMAT_CREATIVE_FASTSPEECH10 0x0203
Packit Service 5a9772
#define WAVE_FORMAT_QUARTERDECK 0x0220
Packit Service 5a9772
#define WAVE_FORMAT_FM_TOWNS_SND 0x0300
Packit Service 5a9772
#define WAVE_FORMAT_BTV_DIGITAL 0x0400
Packit Service 5a9772
#define WAVE_FORMAT_VME_VMPCM 0x0680
Packit Service 5a9772
#define WAVE_FORMAT_OLIGSM 0x1000
Packit Service 5a9772
#define WAVE_FORMAT_OLIADPCM 0x1001
Packit Service 5a9772
#define WAVE_FORMAT_OLICELP 0x1002
Packit Service 5a9772
#define WAVE_FORMAT_OLISBC 0x1003
Packit Service 5a9772
#define WAVE_FORMAT_OLIOPR 0x1004
Packit Service 5a9772
#define WAVE_FORMAT_LH_CODEC 0x1100
Packit Service 5a9772
#define WAVE_FORMAT_NORRIS 0x1400
Packit Service 5a9772
#define WAVE_FORMAT_SOUNDSPACE_MUSICOMPRESS 0x1500
Packit Service 5a9772
#define WAVE_FORMAT_DVM 0x2000
Packit Service 5a9772
#define WAVE_FORMAT_AAC_MS 0xA106
Packit 1fb8d4
Packit 1fb8d4
/**
Packit 1fb8d4
 * Audio Format Functions
Packit 1fb8d4
 */
Packit 1fb8d4
Packit 1fb8d4
#ifdef __cplusplus
Packit Service 5a9772
extern "C"
Packit Service 5a9772
{
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit Service 5a9772
	FREERDP_API UINT32 audio_format_compute_time_length(const AUDIO_FORMAT* format, size_t size);
Packit 1fb8d4
Packit Service 5a9772
	FREERDP_API char* audio_format_get_tag_string(UINT16 wFormatTag);
Packit 1fb8d4
Packit Service 5a9772
	FREERDP_API void audio_format_print(wLog* log, DWORD level, const AUDIO_FORMAT* format);
Packit Service 5a9772
	FREERDP_API void audio_formats_print(wLog* log, DWORD level, const AUDIO_FORMAT* formats,
Packit Service 5a9772
	                                     UINT16 count);
Packit 1fb8d4
Packit Service 5a9772
	FREERDP_API BOOL audio_format_read(wStream* s, AUDIO_FORMAT* format);
Packit Service 5a9772
	FREERDP_API BOOL audio_format_write(wStream* s, const AUDIO_FORMAT* format);
Packit Service 5a9772
	FREERDP_API BOOL audio_format_copy(const AUDIO_FORMAT* srcFormat, AUDIO_FORMAT* dstFormat);
Packit Service 5a9772
	FREERDP_API BOOL audio_format_compatible(const AUDIO_FORMAT* with, const AUDIO_FORMAT* what);
Packit 1fb8d4
Packit Service 5a9772
	FREERDP_API AUDIO_FORMAT* audio_format_new(void);
Packit Service 5a9772
	FREERDP_API AUDIO_FORMAT* audio_formats_new(size_t count);
Packit 1fb8d4
Packit Service 5a9772
	FREERDP_API void audio_format_free(AUDIO_FORMAT* format);
Packit Service 5a9772
	FREERDP_API void audio_formats_free(AUDIO_FORMAT* formats, size_t count);
Packit 1fb8d4
Packit 1fb8d4
#ifdef __cplusplus
Packit 1fb8d4
}
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#endif /* FREERDP_CODEC_AUDIO_H */