non-vr lobby, version fix
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c2a7832ead413484391836cfaa4f0a6b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e70c6b0e644598b458dbb42ace191228
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,546 @@
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
namespace CSCore
|
||||
{
|
||||
//Copied from NAudio (including a few modifications)
|
||||
/// <summary>
|
||||
/// Defines all known encoding types. Primary used in the <see cref="WaveFormat" /> class. See
|
||||
/// <see cref="WaveFormat.WaveFormatTag" />.
|
||||
/// </summary>
|
||||
public enum AudioEncoding : short
|
||||
{
|
||||
/// <summary>WAVE_FORMAT_UNKNOWN, Microsoft Corporation</summary>
|
||||
Unknown = 0x0000,
|
||||
|
||||
/// <summary>WAVE_FORMAT_PCM Microsoft Corporation</summary>
|
||||
Pcm = 0x0001,
|
||||
|
||||
/// <summary>WAVE_FORMAT_ADPCM Microsoft Corporation</summary>
|
||||
Adpcm = 0x0002,
|
||||
|
||||
/// <summary>WAVE_FORMAT_IEEE_FLOAT Microsoft Corporation</summary>
|
||||
IeeeFloat = 0x0003,
|
||||
|
||||
/// <summary>WAVE_FORMAT_VSELP Compaq Computer Corp.</summary>
|
||||
Vselp = 0x0004,
|
||||
|
||||
/// <summary>WAVE_FORMAT_IBM_CVSD IBM Corporation</summary>
|
||||
IbmCvsd = 0x0005,
|
||||
|
||||
/// <summary>WAVE_FORMAT_ALAW Microsoft Corporation</summary>
|
||||
ALaw = 0x0006,
|
||||
|
||||
/// <summary>WAVE_FORMAT_MULAW Microsoft Corporation</summary>
|
||||
MuLaw = 0x0007,
|
||||
|
||||
/// <summary>WAVE_FORMAT_DTS Microsoft Corporation</summary>
|
||||
Dts = 0x0008,
|
||||
|
||||
/// <summary>WAVE_FORMAT_DRM Microsoft Corporation</summary>
|
||||
Drm = 0x0009,
|
||||
|
||||
/// <summary>WAVE_FORMAT_WMAVOICE9 </summary>
|
||||
WmaVoice9 = 0x000A,
|
||||
|
||||
/// <summary>WAVE_FORMAT_OKI_ADPCM OKI</summary>
|
||||
OkiAdpcm = 0x0010,
|
||||
|
||||
/// <summary>WAVE_FORMAT_DVI_ADPCM Intel Corporation</summary>
|
||||
DviAdpcm = 0x0011,
|
||||
|
||||
/// <summary>WAVE_FORMAT_IMA_ADPCM Intel Corporation</summary>
|
||||
ImaAdpcm = DviAdpcm,
|
||||
|
||||
/// <summary>WAVE_FORMAT_MEDIASPACE_ADPCM Videologic</summary>
|
||||
MediaspaceAdpcm = 0x0012,
|
||||
|
||||
/// <summary>WAVE_FORMAT_SIERRA_ADPCM Sierra Semiconductor Corp </summary>
|
||||
SierraAdpcm = 0x0013,
|
||||
|
||||
/// <summary>WAVE_FORMAT_G723_ADPCM Antex Electronics Corporation </summary>
|
||||
G723Adpcm = 0x0014,
|
||||
|
||||
/// <summary>WAVE_FORMAT_DIGISTD DSP Solutions, Inc.</summary>
|
||||
DigiStd = 0x0015,
|
||||
|
||||
/// <summary>WAVE_FORMAT_DIGIFIX DSP Solutions, Inc.</summary>
|
||||
DigiFix = 0x0016,
|
||||
|
||||
/// <summary>WAVE_FORMAT_DIALOGIC_OKI_ADPCM Dialogic Corporation</summary>
|
||||
DialogicOkiAdpcm = 0x0017,
|
||||
|
||||
/// <summary>WAVE_FORMAT_MEDIAVISION_ADPCM Media Vision, Inc.</summary>
|
||||
MediaVisionAdpcm = 0x0018,
|
||||
|
||||
/// <summary>WAVE_FORMAT_CU_CODEC Hewlett-Packard Company </summary>
|
||||
CUCodec = 0x0019,
|
||||
|
||||
/// <summary>WAVE_FORMAT_YAMAHA_ADPCM Yamaha Corporation of America</summary>
|
||||
YamahaAdpcm = 0x0020,
|
||||
|
||||
/// <summary>WAVE_FORMAT_SONARC Speech Compression</summary>
|
||||
SonarC = 0x0021,
|
||||
|
||||
/// <summary>WAVE_FORMAT_DSPGROUP_TRUESPEECH DSP Group, Inc </summary>
|
||||
DspGroupTrueSpeech = 0x0022,
|
||||
|
||||
/// <summary>WAVE_FORMAT_ECHOSC1 Echo Speech Corporation</summary>
|
||||
EchoSpeechCorporation1 = 0x0023,
|
||||
|
||||
/// <summary>WAVE_FORMAT_AUDIOFILE_AF36, Virtual Music, Inc.</summary>
|
||||
AudioFileAf36 = 0x0024,
|
||||
|
||||
/// <summary>WAVE_FORMAT_APTX Audio Processing Technology</summary>
|
||||
Aptx = 0x0025,
|
||||
|
||||
/// <summary>WAVE_FORMAT_AUDIOFILE_AF10, Virtual Music, Inc.</summary>
|
||||
AudioFileAf10 = 0x0026,
|
||||
|
||||
/// <summary>WAVE_FORMAT_PROSODY_1612, Aculab plc</summary>
|
||||
Prosody1612 = 0x0027,
|
||||
|
||||
/// <summary>WAVE_FORMAT_LRC, Merging Technologies S.A. </summary>
|
||||
Lrc = 0x0028,
|
||||
|
||||
/// <summary>WAVE_FORMAT_DOLBY_AC2, Dolby Laboratories</summary>
|
||||
DolbyAc2 = 0x0030,
|
||||
|
||||
/// <summary>WAVE_FORMAT_GSM610, Microsoft Corporation</summary>
|
||||
Gsm610 = 0x0031,
|
||||
|
||||
/// <summary>WAVE_FORMAT_MSNAUDIO, Microsoft Corporation</summary>
|
||||
MsnAudio = 0x0032,
|
||||
|
||||
/// <summary>WAVE_FORMAT_ANTEX_ADPCME, Antex Electronics Corporation</summary>
|
||||
AntexAdpcme = 0x0033,
|
||||
|
||||
/// <summary>WAVE_FORMAT_CONTROL_RES_VQLPC, Control Resources Limited </summary>
|
||||
ControlResVqlpc = 0x0034,
|
||||
|
||||
/// <summary>WAVE_FORMAT_DIGIREAL, DSP Solutions, Inc. </summary>
|
||||
DigiReal = 0x0035,
|
||||
|
||||
/// <summary>WAVE_FORMAT_DIGIADPCM, DSP Solutions, Inc.</summary>
|
||||
DigiAdpcm = 0x0036,
|
||||
|
||||
/// <summary>WAVE_FORMAT_CONTROL_RES_CR10, Control Resources Limited</summary>
|
||||
ControlResCr10 = 0x0037,
|
||||
|
||||
/// <summary>WAVE_FORMAT_NMS_VBXADPCM</summary>
|
||||
WAVE_FORMAT_NMS_VBXADPCM = 0x0038, // Natural MicroSystems
|
||||
|
||||
/// <summary>WAVE_FORMAT_CS_IMAADPCM</summary>
|
||||
WAVE_FORMAT_CS_IMAADPCM = 0x0039, // Crystal Semiconductor IMA ADPCM
|
||||
|
||||
/// <summary>WAVE_FORMAT_ECHOSC3</summary>
|
||||
WAVE_FORMAT_ECHOSC3 = 0x003A, // Echo Speech Corporation
|
||||
|
||||
/// <summary>WAVE_FORMAT_ROCKWELL_ADPCM</summary>
|
||||
WAVE_FORMAT_ROCKWELL_ADPCM = 0x003B, // Rockwell International
|
||||
|
||||
/// <summary>WAVE_FORMAT_ROCKWELL_DIGITALK</summary>
|
||||
WAVE_FORMAT_ROCKWELL_DIGITALK = 0x003C, // Rockwell International
|
||||
|
||||
/// <summary>WAVE_FORMAT_XEBEC</summary>
|
||||
WAVE_FORMAT_XEBEC = 0x003D, // Xebec Multimedia Solutions Limited
|
||||
|
||||
/// <summary>WAVE_FORMAT_G721_ADPCM</summary>
|
||||
WAVE_FORMAT_G721_ADPCM = 0x0040, // Antex Electronics Corporation
|
||||
|
||||
/// <summary>WAVE_FORMAT_G728_CELP</summary>
|
||||
WAVE_FORMAT_G728_CELP = 0x0041, // Antex Electronics Corporation
|
||||
|
||||
/// <summary>WAVE_FORMAT_MSG723</summary>
|
||||
WAVE_FORMAT_MSG723 = 0x0042, // Microsoft Corporation
|
||||
|
||||
/// <summary>WAVE_FORMAT_MPEG, Microsoft Corporation </summary>
|
||||
Mpeg = 0x0050,
|
||||
|
||||
/// <summary>WAVE_FORMAT_RT24</summary>
|
||||
WAVE_FORMAT_RT24 = 0x0052, // InSoft, Inc.
|
||||
|
||||
/// <summary>WAVE_FORMAT_PAC</summary>
|
||||
WAVE_FORMAT_PAC = 0x0053, // InSoft, Inc.
|
||||
|
||||
/// <summary>WAVE_FORMAT_MPEGLAYER3, ISO/MPEG Layer3 Format Tag </summary>
|
||||
MpegLayer3 = 0x0055,
|
||||
|
||||
/// <summary>WAVE_FORMAT_LUCENT_G723</summary>
|
||||
WAVE_FORMAT_LUCENT_G723 = 0x0059, // Lucent Technologies
|
||||
|
||||
/// <summary>WAVE_FORMAT_CIRRUS</summary>
|
||||
WAVE_FORMAT_CIRRUS = 0x0060, // Cirrus Logic
|
||||
|
||||
/// <summary>WAVE_FORMAT_ESPCM</summary>
|
||||
WAVE_FORMAT_ESPCM = 0x0061, // ESS Technology
|
||||
|
||||
/// <summary>WAVE_FORMAT_VOXWARE</summary>
|
||||
WAVE_FORMAT_VOXWARE = 0x0062, // Voxware Inc
|
||||
|
||||
/// <summary>WAVE_FORMAT_CANOPUS_ATRAC</summary>
|
||||
WAVE_FORMAT_CANOPUS_ATRAC = 0x0063, // Canopus, co., Ltd.
|
||||
|
||||
/// <summary>WAVE_FORMAT_G726_ADPCM</summary>
|
||||
WAVE_FORMAT_G726_ADPCM = 0x0064, // APICOM
|
||||
|
||||
/// <summary>WAVE_FORMAT_G722_ADPCM</summary>
|
||||
WAVE_FORMAT_G722_ADPCM = 0x0065, // APICOM
|
||||
|
||||
/// <summary>WAVE_FORMAT_DSAT_DISPLAY</summary>
|
||||
WAVE_FORMAT_DSAT_DISPLAY = 0x0067, // Microsoft Corporation
|
||||
|
||||
/// <summary>WAVE_FORMAT_VOXWARE_BYTE_ALIGNED</summary>
|
||||
WAVE_FORMAT_VOXWARE_BYTE_ALIGNED = 0x0069, // Voxware Inc
|
||||
|
||||
/// <summary>WAVE_FORMAT_VOXWARE_AC8</summary>
|
||||
WAVE_FORMAT_VOXWARE_AC8 = 0x0070, // Voxware Inc
|
||||
|
||||
/// <summary>WAVE_FORMAT_VOXWARE_AC10</summary>
|
||||
WAVE_FORMAT_VOXWARE_AC10 = 0x0071, // Voxware Inc
|
||||
|
||||
/// <summary>WAVE_FORMAT_VOXWARE_AC16</summary>
|
||||
WAVE_FORMAT_VOXWARE_AC16 = 0x0072, // Voxware Inc
|
||||
|
||||
/// <summary>WAVE_FORMAT_VOXWARE_AC20</summary>
|
||||
WAVE_FORMAT_VOXWARE_AC20 = 0x0073, // Voxware Inc
|
||||
|
||||
/// <summary>WAVE_FORMAT_VOXWARE_RT24</summary>
|
||||
WAVE_FORMAT_VOXWARE_RT24 = 0x0074, // Voxware Inc
|
||||
|
||||
/// <summary>WAVE_FORMAT_VOXWARE_RT29</summary>
|
||||
WAVE_FORMAT_VOXWARE_RT29 = 0x0075, // Voxware Inc
|
||||
|
||||
/// <summary>WAVE_FORMAT_VOXWARE_RT29HW</summary>
|
||||
WAVE_FORMAT_VOXWARE_RT29HW = 0x0076, // Voxware Inc
|
||||
|
||||
/// <summary>WAVE_FORMAT_VOXWARE_VR12</summary>
|
||||
WAVE_FORMAT_VOXWARE_VR12 = 0x0077, // Voxware Inc
|
||||
|
||||
/// <summary>WAVE_FORMAT_VOXWARE_VR18</summary>
|
||||
WAVE_FORMAT_VOXWARE_VR18 = 0x0078, // Voxware Inc
|
||||
|
||||
/// <summary>WAVE_FORMAT_VOXWARE_TQ40</summary>
|
||||
WAVE_FORMAT_VOXWARE_TQ40 = 0x0079, // Voxware Inc
|
||||
|
||||
/// <summary>WAVE_FORMAT_SOFTSOUND</summary>
|
||||
WAVE_FORMAT_SOFTSOUND = 0x0080, // Softsound, Ltd.
|
||||
|
||||
/// <summary>WAVE_FORMAT_VOXWARE_TQ60</summary>
|
||||
WAVE_FORMAT_VOXWARE_TQ60 = 0x0081, // Voxware Inc
|
||||
|
||||
/// <summary>WAVE_FORMAT_MSRT24</summary>
|
||||
WAVE_FORMAT_MSRT24 = 0x0082, // Microsoft Corporation
|
||||
|
||||
/// <summary>WAVE_FORMAT_G729A</summary>
|
||||
WAVE_FORMAT_G729A = 0x0083, // AT&T Labs, Inc.
|
||||
|
||||
/// <summary>WAVE_FORMAT_MVI_MVI2</summary>
|
||||
WAVE_FORMAT_MVI_MVI2 = 0x0084, // Motion Pixels
|
||||
|
||||
/// <summary>WAVE_FORMAT_DF_G726</summary>
|
||||
WAVE_FORMAT_DF_G726 = 0x0085, // DataFusion Systems (Pty) (Ltd)
|
||||
|
||||
/// <summary>WAVE_FORMAT_DF_GSM610</summary>
|
||||
WAVE_FORMAT_DF_GSM610 = 0x0086, // DataFusion Systems (Pty) (Ltd)
|
||||
|
||||
/// <summary>WAVE_FORMAT_ISIAUDIO</summary>
|
||||
WAVE_FORMAT_ISIAUDIO = 0x0088, // Iterated Systems, Inc.
|
||||
|
||||
/// <summary>WAVE_FORMAT_ONLIVE</summary>
|
||||
WAVE_FORMAT_ONLIVE = 0x0089, // OnLive! Technologies, Inc.
|
||||
|
||||
/// <summary>WAVE_FORMAT_SBC24</summary>
|
||||
WAVE_FORMAT_SBC24 = 0x0091, // Siemens Business Communications Sys
|
||||
|
||||
/// <summary>WAVE_FORMAT_DOLBY_AC3_SPDIF</summary>
|
||||
WAVE_FORMAT_DOLBY_AC3_SPDIF = 0x0092, // Sonic Foundry
|
||||
|
||||
/// <summary>WAVE_FORMAT_MEDIASONIC_G723</summary>
|
||||
WAVE_FORMAT_MEDIASONIC_G723 = 0x0093, // MediaSonic
|
||||
|
||||
/// <summary>WAVE_FORMAT_PROSODY_8KBPS</summary>
|
||||
WAVE_FORMAT_PROSODY_8KBPS = 0x0094, // Aculab plc
|
||||
|
||||
/// <summary>WAVE_FORMAT_ZYXEL_ADPCM</summary>
|
||||
WAVE_FORMAT_ZYXEL_ADPCM = 0x0097, // ZyXEL Communications, Inc.
|
||||
|
||||
/// <summary>WAVE_FORMAT_PHILIPS_LPCBB</summary>
|
||||
WAVE_FORMAT_PHILIPS_LPCBB = 0x0098, // Philips Speech Processing
|
||||
|
||||
/// <summary>WAVE_FORMAT_PACKED</summary>
|
||||
WAVE_FORMAT_PACKED = 0x0099, // Studer Professional Audio AG
|
||||
|
||||
/// <summary>WAVE_FORMAT_MALDEN_PHONYTALK</summary>
|
||||
WAVE_FORMAT_MALDEN_PHONYTALK = 0x00A0, // Malden Electronics Ltd.
|
||||
|
||||
/// <summary>WAVE_FORMAT_GSM</summary>
|
||||
Gsm = 0x00A1,
|
||||
|
||||
/// <summary>WAVE_FORMAT_G729</summary>
|
||||
G729 = 0x00A2,
|
||||
|
||||
/// <summary>WAVE_FORMAT_G723</summary>
|
||||
G723 = 0x00A3,
|
||||
|
||||
/// <summary>WAVE_FORMAT_ACELP</summary>
|
||||
Acelp = 0x00A4,
|
||||
|
||||
/// <summary>
|
||||
/// WAVE_FORMAT_RAW_AAC1
|
||||
/// </summary>
|
||||
RawAac = 0x00FF,
|
||||
|
||||
/// <summary>WAVE_FORMAT_RHETOREX_ADPCM</summary>
|
||||
WAVE_FORMAT_RHETOREX_ADPCM = 0x0100, // Rhetorex Inc.
|
||||
|
||||
/// <summary>WAVE_FORMAT_IRAT</summary>
|
||||
WAVE_FORMAT_IRAT = 0x0101, // BeCubed Software Inc.
|
||||
|
||||
/// <summary>WAVE_FORMAT_VIVO_G723</summary>
|
||||
WAVE_FORMAT_VIVO_G723 = 0x0111, // Vivo Software
|
||||
|
||||
/// <summary>WAVE_FORMAT_VIVO_SIREN</summary>
|
||||
WAVE_FORMAT_VIVO_SIREN = 0x0112, // Vivo Software
|
||||
|
||||
/// <summary>WAVE_FORMAT_DIGITAL_G723</summary>
|
||||
WAVE_FORMAT_DIGITAL_G723 = 0x0123, // Digital Equipment Corporation
|
||||
|
||||
/// <summary>WAVE_FORMAT_SANYO_LD_ADPCM</summary>
|
||||
WAVE_FORMAT_SANYO_LD_ADPCM = 0x0125, // Sanyo Electric Co., Ltd.
|
||||
|
||||
/// <summary>WAVE_FORMAT_SIPROLAB_ACEPLNET</summary>
|
||||
WAVE_FORMAT_SIPROLAB_ACEPLNET = 0x0130, // Sipro Lab Telecom Inc.
|
||||
|
||||
/// <summary>WAVE_FORMAT_SIPROLAB_ACELP4800</summary>
|
||||
WAVE_FORMAT_SIPROLAB_ACELP4800 = 0x0131, // Sipro Lab Telecom Inc.
|
||||
|
||||
/// <summary>WAVE_FORMAT_SIPROLAB_ACELP8V3</summary>
|
||||
WAVE_FORMAT_SIPROLAB_ACELP8V3 = 0x0132, // Sipro Lab Telecom Inc.
|
||||
|
||||
/// <summary>WAVE_FORMAT_SIPROLAB_G729</summary>
|
||||
WAVE_FORMAT_SIPROLAB_G729 = 0x0133, // Sipro Lab Telecom Inc.
|
||||
|
||||
/// <summary>WAVE_FORMAT_SIPROLAB_G729A</summary>
|
||||
WAVE_FORMAT_SIPROLAB_G729A = 0x0134, // Sipro Lab Telecom Inc.
|
||||
|
||||
/// <summary>WAVE_FORMAT_SIPROLAB_KELVIN</summary>
|
||||
WAVE_FORMAT_SIPROLAB_KELVIN = 0x0135, // Sipro Lab Telecom Inc.
|
||||
|
||||
/// <summary>WAVE_FORMAT_G726ADPCM</summary>
|
||||
WAVE_FORMAT_G726ADPCM = 0x0140, // Dictaphone Corporation
|
||||
|
||||
/// <summary>WAVE_FORMAT_QUALCOMM_PUREVOICE</summary>
|
||||
WAVE_FORMAT_QUALCOMM_PUREVOICE = 0x0150, // Qualcomm, Inc.
|
||||
|
||||
/// <summary>WAVE_FORMAT_QUALCOMM_HALFRATE</summary>
|
||||
WAVE_FORMAT_QUALCOMM_HALFRATE = 0x0151, // Qualcomm, Inc.
|
||||
|
||||
/// <summary>WAVE_FORMAT_TUBGSM</summary>
|
||||
WAVE_FORMAT_TUBGSM = 0x0155, // Ring Zero Systems, Inc.
|
||||
|
||||
/// <summary>WAVE_FORMAT_MSAUDIO1</summary>
|
||||
WAVE_FORMAT_MSAUDIO1 = 0x0160, // Microsoft Corporation
|
||||
|
||||
/// <summary>
|
||||
/// Windows Media Audio, WAVE_FORMAT_WMAUDIO2, Microsoft Corporation
|
||||
/// </summary>
|
||||
WindowsMediaAudio = 0x0161,
|
||||
|
||||
/// <summary>
|
||||
/// Windows Media Audio Professional WAVE_FORMAT_WMAUDIO3, Microsoft Corporation
|
||||
/// </summary>
|
||||
WindowsMediaAudioProfessional = 0x0162,
|
||||
|
||||
/// <summary>
|
||||
/// Windows Media Audio Lossless, WAVE_FORMAT_WMAUDIO_LOSSLESS
|
||||
/// </summary>
|
||||
WindowsMediaAudioLosseless = 0x0163,
|
||||
|
||||
/// <summary>
|
||||
/// Windows Media Audio Professional over SPDIF WAVE_FORMAT_WMASPDIF (0x0164)
|
||||
/// </summary>
|
||||
WindowsMediaAudioSpdif = 0x0164,
|
||||
|
||||
/// <summary>WAVE_FORMAT_UNISYS_NAP_ADPCM</summary>
|
||||
WAVE_FORMAT_UNISYS_NAP_ADPCM = 0x0170, // Unisys Corp.
|
||||
|
||||
/// <summary>WAVE_FORMAT_UNISYS_NAP_ULAW</summary>
|
||||
WAVE_FORMAT_UNISYS_NAP_ULAW = 0x0171, // Unisys Corp.
|
||||
|
||||
/// <summary>WAVE_FORMAT_UNISYS_NAP_ALAW</summary>
|
||||
WAVE_FORMAT_UNISYS_NAP_ALAW = 0x0172, // Unisys Corp.
|
||||
|
||||
/// <summary>WAVE_FORMAT_UNISYS_NAP_16K</summary>
|
||||
WAVE_FORMAT_UNISYS_NAP_16K = 0x0173, // Unisys Corp.
|
||||
|
||||
/// <summary>WAVE_FORMAT_CREATIVE_ADPCM</summary>
|
||||
WAVE_FORMAT_CREATIVE_ADPCM = 0x0200, // Creative Labs, Inc
|
||||
|
||||
/// <summary>WAVE_FORMAT_CREATIVE_FASTSPEECH8</summary>
|
||||
WAVE_FORMAT_CREATIVE_FASTSPEECH8 = 0x0202, // Creative Labs, Inc
|
||||
|
||||
/// <summary>WAVE_FORMAT_CREATIVE_FASTSPEECH10</summary>
|
||||
WAVE_FORMAT_CREATIVE_FASTSPEECH10 = 0x0203, // Creative Labs, Inc
|
||||
|
||||
/// <summary>WAVE_FORMAT_UHER_ADPCM</summary>
|
||||
WAVE_FORMAT_UHER_ADPCM = 0x0210, // UHER informatic GmbH
|
||||
|
||||
/// <summary>WAVE_FORMAT_QUARTERDECK</summary>
|
||||
WAVE_FORMAT_QUARTERDECK = 0x0220, // Quarterdeck Corporation
|
||||
|
||||
/// <summary>WAVE_FORMAT_ILINK_VC</summary>
|
||||
WAVE_FORMAT_ILINK_VC = 0x0230, // I-link Worldwide
|
||||
|
||||
/// <summary>WAVE_FORMAT_RAW_SPORT</summary>
|
||||
WAVE_FORMAT_RAW_SPORT = 0x0240, // Aureal Semiconductor
|
||||
|
||||
/// <summary>WAVE_FORMAT_ESST_AC3</summary>
|
||||
WAVE_FORMAT_ESST_AC3 = 0x0241, // ESS Technology, Inc.
|
||||
|
||||
/// <summary>WAVE_FORMAT_IPI_HSX</summary>
|
||||
WAVE_FORMAT_IPI_HSX = 0x0250, // Interactive Products, Inc.
|
||||
|
||||
/// <summary>WAVE_FORMAT_IPI_RPELP</summary>
|
||||
WAVE_FORMAT_IPI_RPELP = 0x0251, // Interactive Products, Inc.
|
||||
|
||||
/// <summary>WAVE_FORMAT_CS2</summary>
|
||||
WAVE_FORMAT_CS2 = 0x0260, // Consistent Software
|
||||
|
||||
/// <summary>WAVE_FORMAT_SONY_SCX</summary>
|
||||
WAVE_FORMAT_SONY_SCX = 0x0270, // Sony Corp.
|
||||
|
||||
/// <summary>WAVE_FORMAT_FM_TOWNS_SND</summary>
|
||||
WAVE_FORMAT_FM_TOWNS_SND = 0x0300, // Fujitsu Corp.
|
||||
|
||||
/// <summary>WAVE_FORMAT_BTV_DIGITAL</summary>
|
||||
WAVE_FORMAT_BTV_DIGITAL = 0x0400, // Brooktree Corporation
|
||||
|
||||
/// <summary>WAVE_FORMAT_QDESIGN_MUSIC</summary>
|
||||
WAVE_FORMAT_QDESIGN_MUSIC = 0x0450, // QDesign Corporation
|
||||
|
||||
/// <summary>WAVE_FORMAT_VME_VMPCM</summary>
|
||||
WAVE_FORMAT_VME_VMPCM = 0x0680, // AT&T Labs, Inc.
|
||||
|
||||
/// <summary>WAVE_FORMAT_TPC</summary>
|
||||
WAVE_FORMAT_TPC = 0x0681, // AT&T Labs, Inc.
|
||||
|
||||
/// <summary>WAVE_FORMAT_OLIGSM</summary>
|
||||
WAVE_FORMAT_OLIGSM = 0x1000, // Ing C. Olivetti & C., S.p.A.
|
||||
|
||||
/// <summary>WAVE_FORMAT_OLIADPCM</summary>
|
||||
WAVE_FORMAT_OLIADPCM = 0x1001, // Ing C. Olivetti & C., S.p.A.
|
||||
|
||||
/// <summary>WAVE_FORMAT_OLICELP</summary>
|
||||
WAVE_FORMAT_OLICELP = 0x1002, // Ing C. Olivetti & C., S.p.A.
|
||||
|
||||
/// <summary>WAVE_FORMAT_OLISBC</summary>
|
||||
WAVE_FORMAT_OLISBC = 0x1003, // Ing C. Olivetti & C., S.p.A.
|
||||
|
||||
/// <summary>WAVE_FORMAT_OLIOPR</summary>
|
||||
WAVE_FORMAT_OLIOPR = 0x1004, // Ing C. Olivetti & C., S.p.A.
|
||||
|
||||
/// <summary>WAVE_FORMAT_LH_CODEC</summary>
|
||||
WAVE_FORMAT_LH_CODEC = 0x1100, // Lernout & Hauspie
|
||||
|
||||
/// <summary>WAVE_FORMAT_NORRIS</summary>
|
||||
WAVE_FORMAT_NORRIS = 0x1400, // Norris Communications, Inc.
|
||||
|
||||
/// <summary>WAVE_FORMAT_SOUNDSPACE_MUSICOMPRESS</summary>
|
||||
WAVE_FORMAT_SOUNDSPACE_MUSICOMPRESS = 0x1500, // AT&T Labs, Inc.
|
||||
|
||||
/// <summary>
|
||||
/// Advanced Audio Coding (AAC) audio in Audio Data Transport Stream (ADTS) format.
|
||||
/// The format block is a WAVEFORMATEX structure with wFormatTag equal to WAVE_FORMAT_MPEG_ADTS_AAC.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The WAVEFORMATEX structure specifies the core AAC-LC sample rate and number of channels,
|
||||
/// prior to applying spectral band replication (SBR) or parametric stereo (PS) tools, if present.
|
||||
/// No additional data is required after the WAVEFORMATEX structure.
|
||||
/// </remarks>
|
||||
/// <see>http://msdn.microsoft.com/en-us/library/dd317599%28VS.85%29.aspx</see>
|
||||
MPEG_ADTS_AAC = 0x1600,
|
||||
|
||||
/// <summary>MPEG_RAW_AAC</summary>
|
||||
/// <remarks>Source wmCodec.h</remarks>
|
||||
MPEG_RAW_AAC = 0x1601,
|
||||
|
||||
/// <summary>
|
||||
/// MPEG-4 audio transport stream with a synchronization layer (LOAS) and a multiplex layer (LATM).
|
||||
/// The format block is a WAVEFORMATEX structure with wFormatTag equal to WAVE_FORMAT_MPEG_LOAS.
|
||||
/// See <see href="http://msdn.microsoft.com/en-us/library/dd317599%28VS.85%29.aspx"/>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The WAVEFORMATEX structure specifies the core AAC-LC sample rate and number of channels,
|
||||
/// prior to applying spectral SBR or PS tools, if present.
|
||||
/// No additional data is required after the WAVEFORMATEX structure.
|
||||
/// </remarks>
|
||||
MPEG_LOAS = 0x1602,
|
||||
|
||||
/// <summary>NOKIA_MPEG_ADTS_AAC</summary>
|
||||
/// <remarks>Source wmCodec.h</remarks>
|
||||
NOKIA_MPEG_ADTS_AAC = 0x1608,
|
||||
|
||||
/// <summary>NOKIA_MPEG_RAW_AAC</summary>
|
||||
/// <remarks>Source wmCodec.h</remarks>
|
||||
NOKIA_MPEG_RAW_AAC = 0x1609,
|
||||
|
||||
/// <summary>VODAFONE_MPEG_ADTS_AAC</summary>
|
||||
/// <remarks>Source wmCodec.h</remarks>
|
||||
VODAFONE_MPEG_ADTS_AAC = 0x160A,
|
||||
|
||||
/// <summary>VODAFONE_MPEG_RAW_AAC</summary>
|
||||
/// <remarks>Source wmCodec.h</remarks>
|
||||
VODAFONE_MPEG_RAW_AAC = 0x160B,
|
||||
|
||||
/// <summary>
|
||||
/// High-Efficiency Advanced Audio Coding (HE-AAC) stream.
|
||||
/// The format block is an HEAACWAVEFORMAT structure. See <see href="http://msdn.microsoft.com/en-us/library/dd317599%28VS.85%29.aspx"/>.
|
||||
/// </summary>
|
||||
MPEG_HEAAC = 0x1610,
|
||||
|
||||
/// <summary>WAVE_FORMAT_DVM</summary>
|
||||
WAVE_FORMAT_DVM = 0x2000, // FAST Multimedia AG
|
||||
|
||||
// others - not from MS headers
|
||||
/// <summary>WAVE_FORMAT_VORBIS1 "Og" Original stream compatible</summary>
|
||||
Vorbis1 = 0x674f,
|
||||
|
||||
/// <summary>WAVE_FORMAT_VORBIS2 "Pg" Have independent header</summary>
|
||||
Vorbis2 = 0x6750,
|
||||
|
||||
/// <summary>WAVE_FORMAT_VORBIS3 "Qg" Have no codebook header</summary>
|
||||
Vorbis3 = 0x6751,
|
||||
|
||||
/// <summary>WAVE_FORMAT_VORBIS1P "og" Original stream compatible</summary>
|
||||
Vorbis1P = 0x676f,
|
||||
|
||||
/// <summary>WAVE_FORMAT_VORBIS2P "pg" Have independent headere</summary>
|
||||
Vorbis2P = 0x6770,
|
||||
|
||||
/// <summary>WAVE_FORMAT_VORBIS3P "qg" Have no codebook header</summary>
|
||||
Vorbis3P = 0x6771,
|
||||
|
||||
/// <summary>
|
||||
/// Raw AAC1
|
||||
/// </summary>
|
||||
WAVE_FORMAT_RAW_AAC1 = 0x00FF,
|
||||
|
||||
/// <summary>
|
||||
/// Windows Media Audio Voice (WMA Voice)
|
||||
/// </summary>
|
||||
WAVE_FORMAT_WMAVOICE9 = 0x000A,
|
||||
|
||||
/// <summary>Extensible</summary>
|
||||
Extensible = unchecked((short)0xFFFE), // Microsoft
|
||||
|
||||
/// <summary>WAVE_FORMAT_DEVELOPMENT</summary>
|
||||
WAVE_FORMAT_DEVELOPMENT = unchecked((short)0xFFFF),
|
||||
|
||||
/// <summary>
|
||||
/// FLAC
|
||||
/// </summary>
|
||||
WAVE_FORMAT_FLAC = unchecked((short)0xF1AC)
|
||||
}
|
||||
}
|
||||
|
||||
// ReSharper restore InconsistentNaming
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 14a588271ffedcb44968c878818b7871
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
|
||||
namespace CSCore
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines <see cref="AudioSubTypes"/> and provides methods to convert between <see cref="AudioEncoding"/>-values and <see cref="AudioSubTypes"/>-values.
|
||||
/// </summary>
|
||||
/// <remarks><see cref="AudioSubTypes"/> are used by the <see cref="WaveFormatExtensible"/>, the <see cref="MFMediaType"/> and the <see cref="MediaType"/> class.</remarks>
|
||||
public static partial class AudioSubTypes
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts a <see cref="AudioSubTypes"/>-value to a <see cref="AudioEncoding"/>-value.
|
||||
/// </summary>
|
||||
/// <param name="audioSubType">The <see cref="AudioSubTypes"/>-value to convert to the equivalent <see cref="AudioEncoding"/>-value.</param>
|
||||
/// <returns>The <see cref="AudioEncoding"/> which belongs to the specified <paramref name="audioSubType"/>.</returns>
|
||||
public static AudioEncoding EncodingFromSubType(Guid audioSubType)
|
||||
{
|
||||
var bytes = audioSubType.ToByteArray();
|
||||
int value = BitConverter.ToInt32(bytes, 0);
|
||||
if (Enum.IsDefined(typeof(AudioEncoding), (short)value))
|
||||
return (AudioEncoding)value;
|
||||
|
||||
throw new ArgumentException("Invalid audioSubType.", "audioSubType");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a <see cref="AudioEncoding"/> value to a <see cref="AudioSubTypes"/>-value.
|
||||
/// </summary>
|
||||
/// <param name="audioEncoding">The <see cref="AudioEncoding"/> to convert to the equivalent <see cref="AudioSubTypes"/>-value.</param>
|
||||
/// <returns>The <see cref="AudioSubTypes"/>-value which belongs to the specified <paramref name="audioEncoding"/>.</returns>
|
||||
public static Guid SubTypeFromEncoding(AudioEncoding audioEncoding)
|
||||
{
|
||||
if (Enum.IsDefined(typeof(AudioEncoding), (short)audioEncoding))
|
||||
return new Guid((int)audioEncoding, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
|
||||
throw new ArgumentException("Invalid encoding.", "audioEncoding");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The Major Type for <c>Audio</c> media types.
|
||||
/// </summary>
|
||||
public static readonly Guid MediaTypeAudio = new Guid("73647561-0000-0010-8000-00AA00389B71");
|
||||
|
||||
///// <summary>
|
||||
///// FLAC
|
||||
///// </summary>
|
||||
//public static readonly Guid WAVE_FORMAT_FLAC = new Guid("0000f1ac-0000-0010-8000-00aa00389b71");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 03a5e54186895d548a426573dcd38b22
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,381 @@
|
||||
using System;
|
||||
|
||||
namespace CSCore
|
||||
{
|
||||
public static partial class AudioSubTypes
|
||||
{
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
/// <summary>WAVE_FORMAT_UNKNOWN, Microsoft Corporation</summary>
|
||||
public static readonly Guid Unknown = new Guid((short)AudioEncoding.Unknown & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_PCM Microsoft Corporation</summary>
|
||||
public static readonly Guid Pcm = new Guid((short)AudioEncoding.Pcm & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_ADPCM Microsoft Corporation</summary>
|
||||
public static readonly Guid Adpcm = new Guid((short)AudioEncoding.Adpcm & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_IEEE_FLOAT Microsoft Corporation</summary>
|
||||
public static readonly Guid IeeeFloat = new Guid((short)AudioEncoding.IeeeFloat & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_VSELP Compaq Computer Corp.</summary>
|
||||
public static readonly Guid Vselp = new Guid((short)AudioEncoding.Vselp & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_IBM_CVSD IBM Corporation</summary>
|
||||
public static readonly Guid IbmCvsd = new Guid((short)AudioEncoding.IbmCvsd & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_ALAW Microsoft Corporation</summary>
|
||||
public static readonly Guid ALaw = new Guid((short)AudioEncoding.ALaw & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_MULAW Microsoft Corporation</summary>
|
||||
public static readonly Guid MuLaw = new Guid((short)AudioEncoding.MuLaw & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_DTS Microsoft Corporation</summary>
|
||||
public static readonly Guid Dts = new Guid((short)AudioEncoding.Dts & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_DRM Microsoft Corporation</summary>
|
||||
public static readonly Guid Drm = new Guid((short)AudioEncoding.Drm & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_WMAVOICE9 </summary>
|
||||
public static readonly Guid WmaVoice9 = new Guid((short)AudioEncoding.WmaVoice9 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_OKI_ADPCM OKI</summary>
|
||||
public static readonly Guid OkiAdpcm = new Guid((short)AudioEncoding.OkiAdpcm & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_DVI_ADPCM Intel Corporation</summary>
|
||||
public static readonly Guid DviAdpcm = new Guid((short)AudioEncoding.DviAdpcm & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_IMA_ADPCM Intel Corporation</summary>
|
||||
public static readonly Guid ImaAdpcm = new Guid((short)AudioEncoding.ImaAdpcm & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_MEDIASPACE_ADPCM Videologic</summary>
|
||||
public static readonly Guid MediaspaceAdpcm = new Guid((short)AudioEncoding.MediaspaceAdpcm & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_SIERRA_ADPCM Sierra Semiconductor Corp </summary>
|
||||
public static readonly Guid SierraAdpcm = new Guid((short)AudioEncoding.SierraAdpcm & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_G723_ADPCM Antex Electronics Corporation </summary>
|
||||
public static readonly Guid G723Adpcm = new Guid((short)AudioEncoding.G723Adpcm & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_DIGISTD DSP Solutions, Inc.</summary>
|
||||
public static readonly Guid DigiStd = new Guid((short)AudioEncoding.DigiStd & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_DIGIFIX DSP Solutions, Inc.</summary>
|
||||
public static readonly Guid DigiFix = new Guid((short)AudioEncoding.DigiFix & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_DIALOGIC_OKI_ADPCM Dialogic Corporation</summary>
|
||||
public static readonly Guid DialogicOkiAdpcm = new Guid((short)AudioEncoding.DialogicOkiAdpcm & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_MEDIAVISION_ADPCM Media Vision, Inc.</summary>
|
||||
public static readonly Guid MediaVisionAdpcm = new Guid((short)AudioEncoding.MediaVisionAdpcm & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_CU_CODEC Hewlett-Packard Company </summary>
|
||||
public static readonly Guid CUCodec = new Guid((short)AudioEncoding.CUCodec & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_YAMAHA_ADPCM Yamaha Corporation of America</summary>
|
||||
public static readonly Guid YamahaAdpcm = new Guid((short)AudioEncoding.YamahaAdpcm & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_SONARC Speech Compression</summary>
|
||||
public static readonly Guid SonarC = new Guid((short)AudioEncoding.SonarC & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_DSPGROUP_TRUESPEECH DSP Group, Inc </summary>
|
||||
public static readonly Guid DspGroupTrueSpeech = new Guid((short)AudioEncoding.DspGroupTrueSpeech & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_ECHOSC1 Echo Speech Corporation</summary>
|
||||
public static readonly Guid EchoSpeechCorporation1 = new Guid((short)AudioEncoding.EchoSpeechCorporation1 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_AUDIOFILE_AF36, Virtual Music, Inc.</summary>
|
||||
public static readonly Guid AudioFileAf36 = new Guid((short)AudioEncoding.AudioFileAf36 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_APTX Audio Processing Technology</summary>
|
||||
public static readonly Guid Aptx = new Guid((short)AudioEncoding.Aptx & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_AUDIOFILE_AF10, Virtual Music, Inc.</summary>
|
||||
public static readonly Guid AudioFileAf10 = new Guid((short)AudioEncoding.AudioFileAf10 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_PROSODY_1612, Aculab plc</summary>
|
||||
public static readonly Guid Prosody1612 = new Guid((short)AudioEncoding.Prosody1612 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_LRC, Merging Technologies S.A. </summary>
|
||||
public static readonly Guid Lrc = new Guid((short)AudioEncoding.Lrc & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_DOLBY_AC2, Dolby Laboratories</summary>
|
||||
public static readonly Guid DolbyAc2 = new Guid((short)AudioEncoding.DolbyAc2 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_GSM610, Microsoft Corporation</summary>
|
||||
public static readonly Guid Gsm610 = new Guid((short)AudioEncoding.Gsm610 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_MSNAUDIO, Microsoft Corporation</summary>
|
||||
public static readonly Guid MsnAudio = new Guid((short)AudioEncoding.MsnAudio & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_ANTEX_ADPCME, Antex Electronics Corporation</summary>
|
||||
public static readonly Guid AntexAdpcme = new Guid((short)AudioEncoding.AntexAdpcme & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_CONTROL_RES_VQLPC, Control Resources Limited </summary>
|
||||
public static readonly Guid ControlResVqlpc = new Guid((short)AudioEncoding.ControlResVqlpc & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_DIGIREAL, DSP Solutions, Inc. </summary>
|
||||
public static readonly Guid DigiReal = new Guid((short)AudioEncoding.DigiReal & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_DIGIADPCM, DSP Solutions, Inc.</summary>
|
||||
public static readonly Guid DigiAdpcm = new Guid((short)AudioEncoding.DigiAdpcm & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_CONTROL_RES_CR10, Control Resources Limited</summary>
|
||||
public static readonly Guid ControlResCr10 = new Guid((short)AudioEncoding.ControlResCr10 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_NMS_VBXADPCM</summary>
|
||||
public static readonly Guid WAVE_FORMAT_NMS_VBXADPCM = new Guid((short)AudioEncoding.WAVE_FORMAT_NMS_VBXADPCM & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_CS_IMAADPCM</summary>
|
||||
public static readonly Guid WAVE_FORMAT_CS_IMAADPCM = new Guid((short)AudioEncoding.WAVE_FORMAT_CS_IMAADPCM & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_ECHOSC3</summary>
|
||||
public static readonly Guid WAVE_FORMAT_ECHOSC3 = new Guid((short)AudioEncoding.WAVE_FORMAT_ECHOSC3 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_ROCKWELL_ADPCM</summary>
|
||||
public static readonly Guid WAVE_FORMAT_ROCKWELL_ADPCM = new Guid((short)AudioEncoding.WAVE_FORMAT_ROCKWELL_ADPCM & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_ROCKWELL_DIGITALK</summary>
|
||||
public static readonly Guid WAVE_FORMAT_ROCKWELL_DIGITALK = new Guid((short)AudioEncoding.WAVE_FORMAT_ROCKWELL_DIGITALK & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_XEBEC</summary>
|
||||
public static readonly Guid WAVE_FORMAT_XEBEC = new Guid((short)AudioEncoding.WAVE_FORMAT_XEBEC & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_G721_ADPCM</summary>
|
||||
public static readonly Guid WAVE_FORMAT_G721_ADPCM = new Guid((short)AudioEncoding.WAVE_FORMAT_G721_ADPCM & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_G728_CELP</summary>
|
||||
public static readonly Guid WAVE_FORMAT_G728_CELP = new Guid((short)AudioEncoding.WAVE_FORMAT_G728_CELP & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_MSG723</summary>
|
||||
public static readonly Guid WAVE_FORMAT_MSG723 = new Guid((short)AudioEncoding.WAVE_FORMAT_MSG723 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_MPEG, Microsoft Corporation </summary>
|
||||
public static readonly Guid Mpeg = new Guid((short)AudioEncoding.Mpeg & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_RT24</summary>
|
||||
public static readonly Guid WAVE_FORMAT_RT24 = new Guid((short)AudioEncoding.WAVE_FORMAT_RT24 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_PAC</summary>
|
||||
public static readonly Guid WAVE_FORMAT_PAC = new Guid((short)AudioEncoding.WAVE_FORMAT_PAC & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_MPEGLAYER3, ISO/MPEG Layer3 Format Tag </summary>
|
||||
public static readonly Guid MpegLayer3 = new Guid((short)AudioEncoding.MpegLayer3 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_LUCENT_G723</summary>
|
||||
public static readonly Guid WAVE_FORMAT_LUCENT_G723 = new Guid((short)AudioEncoding.WAVE_FORMAT_LUCENT_G723 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_CIRRUS</summary>
|
||||
public static readonly Guid WAVE_FORMAT_CIRRUS = new Guid((short)AudioEncoding.WAVE_FORMAT_CIRRUS & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_ESPCM</summary>
|
||||
public static readonly Guid WAVE_FORMAT_ESPCM = new Guid((short)AudioEncoding.WAVE_FORMAT_ESPCM & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_VOXWARE</summary>
|
||||
public static readonly Guid WAVE_FORMAT_VOXWARE = new Guid((short)AudioEncoding.WAVE_FORMAT_VOXWARE & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_CANOPUS_ATRAC</summary>
|
||||
public static readonly Guid WAVE_FORMAT_CANOPUS_ATRAC = new Guid((short)AudioEncoding.WAVE_FORMAT_CANOPUS_ATRAC & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_G726_ADPCM</summary>
|
||||
public static readonly Guid WAVE_FORMAT_G726_ADPCM = new Guid((short)AudioEncoding.WAVE_FORMAT_G726_ADPCM & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_G722_ADPCM</summary>
|
||||
public static readonly Guid WAVE_FORMAT_G722_ADPCM = new Guid((short)AudioEncoding.WAVE_FORMAT_G722_ADPCM & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_DSAT_DISPLAY</summary>
|
||||
public static readonly Guid WAVE_FORMAT_DSAT_DISPLAY = new Guid((short)AudioEncoding.WAVE_FORMAT_DSAT_DISPLAY & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_VOXWARE_BYTE_ALIGNED</summary>
|
||||
public static readonly Guid WAVE_FORMAT_VOXWARE_BYTE_ALIGNED = new Guid((short)AudioEncoding.WAVE_FORMAT_VOXWARE_BYTE_ALIGNED & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_VOXWARE_AC8</summary>
|
||||
public static readonly Guid WAVE_FORMAT_VOXWARE_AC8 = new Guid((short)AudioEncoding.WAVE_FORMAT_VOXWARE_AC8 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_VOXWARE_AC10</summary>
|
||||
public static readonly Guid WAVE_FORMAT_VOXWARE_AC10 = new Guid((short)AudioEncoding.WAVE_FORMAT_VOXWARE_AC10 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_VOXWARE_AC16</summary>
|
||||
public static readonly Guid WAVE_FORMAT_VOXWARE_AC16 = new Guid((short)AudioEncoding.WAVE_FORMAT_VOXWARE_AC16 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_VOXWARE_AC20</summary>
|
||||
public static readonly Guid WAVE_FORMAT_VOXWARE_AC20 = new Guid((short)AudioEncoding.WAVE_FORMAT_VOXWARE_AC20 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_VOXWARE_RT24</summary>
|
||||
public static readonly Guid WAVE_FORMAT_VOXWARE_RT24 = new Guid((short)AudioEncoding.WAVE_FORMAT_VOXWARE_RT24 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_VOXWARE_RT29</summary>
|
||||
public static readonly Guid WAVE_FORMAT_VOXWARE_RT29 = new Guid((short)AudioEncoding.WAVE_FORMAT_VOXWARE_RT29 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_VOXWARE_RT29HW</summary>
|
||||
public static readonly Guid WAVE_FORMAT_VOXWARE_RT29HW = new Guid((short)AudioEncoding.WAVE_FORMAT_VOXWARE_RT29HW & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_VOXWARE_VR12</summary>
|
||||
public static readonly Guid WAVE_FORMAT_VOXWARE_VR12 = new Guid((short)AudioEncoding.WAVE_FORMAT_VOXWARE_VR12 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_VOXWARE_VR18</summary>
|
||||
public static readonly Guid WAVE_FORMAT_VOXWARE_VR18 = new Guid((short)AudioEncoding.WAVE_FORMAT_VOXWARE_VR18 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_VOXWARE_TQ40</summary>
|
||||
public static readonly Guid WAVE_FORMAT_VOXWARE_TQ40 = new Guid((short)AudioEncoding.WAVE_FORMAT_VOXWARE_TQ40 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_SOFTSOUND</summary>
|
||||
public static readonly Guid WAVE_FORMAT_SOFTSOUND = new Guid((short)AudioEncoding.WAVE_FORMAT_SOFTSOUND & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_VOXWARE_TQ60</summary>
|
||||
public static readonly Guid WAVE_FORMAT_VOXWARE_TQ60 = new Guid((short)AudioEncoding.WAVE_FORMAT_VOXWARE_TQ60 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_MSRT24</summary>
|
||||
public static readonly Guid WAVE_FORMAT_MSRT24 = new Guid((short)AudioEncoding.WAVE_FORMAT_MSRT24 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_G729A</summary>
|
||||
public static readonly Guid WAVE_FORMAT_G729A = new Guid((short)AudioEncoding.WAVE_FORMAT_G729A & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_MVI_MVI2</summary>
|
||||
public static readonly Guid WAVE_FORMAT_MVI_MVI2 = new Guid((short)AudioEncoding.WAVE_FORMAT_MVI_MVI2 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_DF_G726</summary>
|
||||
public static readonly Guid WAVE_FORMAT_DF_G726 = new Guid((short)AudioEncoding.WAVE_FORMAT_DF_G726 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_DF_GSM610</summary>
|
||||
public static readonly Guid WAVE_FORMAT_DF_GSM610 = new Guid((short)AudioEncoding.WAVE_FORMAT_DF_GSM610 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_ISIAUDIO</summary>
|
||||
public static readonly Guid WAVE_FORMAT_ISIAUDIO = new Guid((short)AudioEncoding.WAVE_FORMAT_ISIAUDIO & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_ONLIVE</summary>
|
||||
public static readonly Guid WAVE_FORMAT_ONLIVE = new Guid((short)AudioEncoding.WAVE_FORMAT_ONLIVE & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_SBC24</summary>
|
||||
public static readonly Guid WAVE_FORMAT_SBC24 = new Guid((short)AudioEncoding.WAVE_FORMAT_SBC24 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_DOLBY_AC3_SPDIF</summary>
|
||||
public static readonly Guid WAVE_FORMAT_DOLBY_AC3_SPDIF = new Guid((short)AudioEncoding.WAVE_FORMAT_DOLBY_AC3_SPDIF & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_MEDIASONIC_G723</summary>
|
||||
public static readonly Guid WAVE_FORMAT_MEDIASONIC_G723 = new Guid((short)AudioEncoding.WAVE_FORMAT_MEDIASONIC_G723 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_PROSODY_8KBPS</summary>
|
||||
public static readonly Guid WAVE_FORMAT_PROSODY_8KBPS = new Guid((short)AudioEncoding.WAVE_FORMAT_PROSODY_8KBPS & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_ZYXEL_ADPCM</summary>
|
||||
public static readonly Guid WAVE_FORMAT_ZYXEL_ADPCM = new Guid((short)AudioEncoding.WAVE_FORMAT_ZYXEL_ADPCM & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_PHILIPS_LPCBB</summary>
|
||||
public static readonly Guid WAVE_FORMAT_PHILIPS_LPCBB = new Guid((short)AudioEncoding.WAVE_FORMAT_PHILIPS_LPCBB & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_PACKED</summary>
|
||||
public static readonly Guid WAVE_FORMAT_PACKED = new Guid((short)AudioEncoding.WAVE_FORMAT_PACKED & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_MALDEN_PHONYTALK</summary>
|
||||
public static readonly Guid WAVE_FORMAT_MALDEN_PHONYTALK = new Guid((short)AudioEncoding.WAVE_FORMAT_MALDEN_PHONYTALK & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_GSM</summary>
|
||||
public static readonly Guid Gsm = new Guid((short)AudioEncoding.Gsm & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_G729</summary>
|
||||
public static readonly Guid G729 = new Guid((short)AudioEncoding.G729 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_G723</summary>
|
||||
public static readonly Guid G723 = new Guid((short)AudioEncoding.G723 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_ACELP</summary>
|
||||
public static readonly Guid Acelp = new Guid((short)AudioEncoding.Acelp & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>
|
||||
/// WAVE_FORMAT_RAW_AAC1
|
||||
/// </summary>
|
||||
public static readonly Guid RawAac = new Guid((short)AudioEncoding.RawAac & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_RHETOREX_ADPCM</summary>
|
||||
public static readonly Guid WAVE_FORMAT_RHETOREX_ADPCM = new Guid((short)AudioEncoding.WAVE_FORMAT_RHETOREX_ADPCM & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_IRAT</summary>
|
||||
public static readonly Guid WAVE_FORMAT_IRAT = new Guid((short)AudioEncoding.WAVE_FORMAT_IRAT & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_VIVO_G723</summary>
|
||||
public static readonly Guid WAVE_FORMAT_VIVO_G723 = new Guid((short)AudioEncoding.WAVE_FORMAT_VIVO_G723 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_VIVO_SIREN</summary>
|
||||
public static readonly Guid WAVE_FORMAT_VIVO_SIREN = new Guid((short)AudioEncoding.WAVE_FORMAT_VIVO_SIREN & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_DIGITAL_G723</summary>
|
||||
public static readonly Guid WAVE_FORMAT_DIGITAL_G723 = new Guid((short)AudioEncoding.WAVE_FORMAT_DIGITAL_G723 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_SANYO_LD_ADPCM</summary>
|
||||
public static readonly Guid WAVE_FORMAT_SANYO_LD_ADPCM = new Guid((short)AudioEncoding.WAVE_FORMAT_SANYO_LD_ADPCM & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_SIPROLAB_ACEPLNET</summary>
|
||||
public static readonly Guid WAVE_FORMAT_SIPROLAB_ACEPLNET = new Guid((short)AudioEncoding.WAVE_FORMAT_SIPROLAB_ACEPLNET & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_SIPROLAB_ACELP4800</summary>
|
||||
public static readonly Guid WAVE_FORMAT_SIPROLAB_ACELP4800 = new Guid((short)AudioEncoding.WAVE_FORMAT_SIPROLAB_ACELP4800 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_SIPROLAB_ACELP8V3</summary>
|
||||
public static readonly Guid WAVE_FORMAT_SIPROLAB_ACELP8V3 = new Guid((short)AudioEncoding.WAVE_FORMAT_SIPROLAB_ACELP8V3 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_SIPROLAB_G729</summary>
|
||||
public static readonly Guid WAVE_FORMAT_SIPROLAB_G729 = new Guid((short)AudioEncoding.WAVE_FORMAT_SIPROLAB_G729 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_SIPROLAB_G729A</summary>
|
||||
public static readonly Guid WAVE_FORMAT_SIPROLAB_G729A = new Guid((short)AudioEncoding.WAVE_FORMAT_SIPROLAB_G729A & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_SIPROLAB_KELVIN</summary>
|
||||
public static readonly Guid WAVE_FORMAT_SIPROLAB_KELVIN = new Guid((short)AudioEncoding.WAVE_FORMAT_SIPROLAB_KELVIN & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_G726ADPCM</summary>
|
||||
public static readonly Guid WAVE_FORMAT_G726ADPCM = new Guid((short)AudioEncoding.WAVE_FORMAT_G726ADPCM & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_QUALCOMM_PUREVOICE</summary>
|
||||
public static readonly Guid WAVE_FORMAT_QUALCOMM_PUREVOICE = new Guid((short)AudioEncoding.WAVE_FORMAT_QUALCOMM_PUREVOICE & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_QUALCOMM_HALFRATE</summary>
|
||||
public static readonly Guid WAVE_FORMAT_QUALCOMM_HALFRATE = new Guid((short)AudioEncoding.WAVE_FORMAT_QUALCOMM_HALFRATE & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_TUBGSM</summary>
|
||||
public static readonly Guid WAVE_FORMAT_TUBGSM = new Guid((short)AudioEncoding.WAVE_FORMAT_TUBGSM & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_MSAUDIO1</summary>
|
||||
public static readonly Guid WAVE_FORMAT_MSAUDIO1 = new Guid((short)AudioEncoding.WAVE_FORMAT_MSAUDIO1 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>
|
||||
/// Windows Media Audio, WAVE_FORMAT_WMAUDIO2, Microsoft Corporation
|
||||
/// </summary>
|
||||
public static readonly Guid WindowsMediaAudio = new Guid((short)AudioEncoding.WindowsMediaAudio & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>
|
||||
/// Windows Media Audio Professional WAVE_FORMAT_WMAUDIO3, Microsoft Corporation
|
||||
/// </summary>
|
||||
public static readonly Guid WindowsMediaAudioProfessional = new Guid((short)AudioEncoding.WindowsMediaAudioProfessional & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>
|
||||
/// Windows Media Audio Lossless, WAVE_FORMAT_WMAUDIO_LOSSLESS
|
||||
/// </summary>
|
||||
public static readonly Guid WindowsMediaAudioLosseless = new Guid((short)AudioEncoding.WindowsMediaAudioLosseless & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>
|
||||
/// Windows Media Audio Professional over SPDIF WAVE_FORMAT_WMASPDIF (0x0164)
|
||||
/// </summary>
|
||||
public static readonly Guid WindowsMediaAudioSpdif = new Guid((short)AudioEncoding.WindowsMediaAudioSpdif & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_UNISYS_NAP_ADPCM</summary>
|
||||
public static readonly Guid WAVE_FORMAT_UNISYS_NAP_ADPCM = new Guid((short)AudioEncoding.WAVE_FORMAT_UNISYS_NAP_ADPCM & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_UNISYS_NAP_ULAW</summary>
|
||||
public static readonly Guid WAVE_FORMAT_UNISYS_NAP_ULAW = new Guid((short)AudioEncoding.WAVE_FORMAT_UNISYS_NAP_ULAW & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_UNISYS_NAP_ALAW</summary>
|
||||
public static readonly Guid WAVE_FORMAT_UNISYS_NAP_ALAW = new Guid((short)AudioEncoding.WAVE_FORMAT_UNISYS_NAP_ALAW & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_UNISYS_NAP_16K</summary>
|
||||
public static readonly Guid WAVE_FORMAT_UNISYS_NAP_16K = new Guid((short)AudioEncoding.WAVE_FORMAT_UNISYS_NAP_16K & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_CREATIVE_ADPCM</summary>
|
||||
public static readonly Guid WAVE_FORMAT_CREATIVE_ADPCM = new Guid((short)AudioEncoding.WAVE_FORMAT_CREATIVE_ADPCM & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_CREATIVE_FASTSPEECH8</summary>
|
||||
public static readonly Guid WAVE_FORMAT_CREATIVE_FASTSPEECH8 = new Guid((short)AudioEncoding.WAVE_FORMAT_CREATIVE_FASTSPEECH8 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_CREATIVE_FASTSPEECH10</summary>
|
||||
public static readonly Guid WAVE_FORMAT_CREATIVE_FASTSPEECH10 = new Guid((short)AudioEncoding.WAVE_FORMAT_CREATIVE_FASTSPEECH10 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_UHER_ADPCM</summary>
|
||||
public static readonly Guid WAVE_FORMAT_UHER_ADPCM = new Guid((short)AudioEncoding.WAVE_FORMAT_UHER_ADPCM & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_QUARTERDECK</summary>
|
||||
public static readonly Guid WAVE_FORMAT_QUARTERDECK = new Guid((short)AudioEncoding.WAVE_FORMAT_QUARTERDECK & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_ILINK_VC</summary>
|
||||
public static readonly Guid WAVE_FORMAT_ILINK_VC = new Guid((short)AudioEncoding.WAVE_FORMAT_ILINK_VC & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_RAW_SPORT</summary>
|
||||
public static readonly Guid WAVE_FORMAT_RAW_SPORT = new Guid((short)AudioEncoding.WAVE_FORMAT_RAW_SPORT & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_ESST_AC3</summary>
|
||||
public static readonly Guid WAVE_FORMAT_ESST_AC3 = new Guid((short)AudioEncoding.WAVE_FORMAT_ESST_AC3 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_IPI_HSX</summary>
|
||||
public static readonly Guid WAVE_FORMAT_IPI_HSX = new Guid((short)AudioEncoding.WAVE_FORMAT_IPI_HSX & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_IPI_RPELP</summary>
|
||||
public static readonly Guid WAVE_FORMAT_IPI_RPELP = new Guid((short)AudioEncoding.WAVE_FORMAT_IPI_RPELP & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_CS2</summary>
|
||||
public static readonly Guid WAVE_FORMAT_CS2 = new Guid((short)AudioEncoding.WAVE_FORMAT_CS2 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_SONY_SCX</summary>
|
||||
public static readonly Guid WAVE_FORMAT_SONY_SCX = new Guid((short)AudioEncoding.WAVE_FORMAT_SONY_SCX & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_FM_TOWNS_SND</summary>
|
||||
public static readonly Guid WAVE_FORMAT_FM_TOWNS_SND = new Guid((short)AudioEncoding.WAVE_FORMAT_FM_TOWNS_SND & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_BTV_DIGITAL</summary>
|
||||
public static readonly Guid WAVE_FORMAT_BTV_DIGITAL = new Guid((short)AudioEncoding.WAVE_FORMAT_BTV_DIGITAL & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_QDESIGN_MUSIC</summary>
|
||||
public static readonly Guid WAVE_FORMAT_QDESIGN_MUSIC = new Guid((short)AudioEncoding.WAVE_FORMAT_QDESIGN_MUSIC & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_VME_VMPCM</summary>
|
||||
public static readonly Guid WAVE_FORMAT_VME_VMPCM = new Guid((short)AudioEncoding.WAVE_FORMAT_VME_VMPCM & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_TPC</summary>
|
||||
public static readonly Guid WAVE_FORMAT_TPC = new Guid((short)AudioEncoding.WAVE_FORMAT_TPC & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_OLIGSM</summary>
|
||||
public static readonly Guid WAVE_FORMAT_OLIGSM = new Guid((short)AudioEncoding.WAVE_FORMAT_OLIGSM & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_OLIADPCM</summary>
|
||||
public static readonly Guid WAVE_FORMAT_OLIADPCM = new Guid((short)AudioEncoding.WAVE_FORMAT_OLIADPCM & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_OLICELP</summary>
|
||||
public static readonly Guid WAVE_FORMAT_OLICELP = new Guid((short)AudioEncoding.WAVE_FORMAT_OLICELP & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_OLISBC</summary>
|
||||
public static readonly Guid WAVE_FORMAT_OLISBC = new Guid((short)AudioEncoding.WAVE_FORMAT_OLISBC & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_OLIOPR</summary>
|
||||
public static readonly Guid WAVE_FORMAT_OLIOPR = new Guid((short)AudioEncoding.WAVE_FORMAT_OLIOPR & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_LH_CODEC</summary>
|
||||
public static readonly Guid WAVE_FORMAT_LH_CODEC = new Guid((short)AudioEncoding.WAVE_FORMAT_LH_CODEC & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_NORRIS</summary>
|
||||
public static readonly Guid WAVE_FORMAT_NORRIS = new Guid((short)AudioEncoding.WAVE_FORMAT_NORRIS & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_SOUNDSPACE_MUSICOMPRESS</summary>
|
||||
public static readonly Guid WAVE_FORMAT_SOUNDSPACE_MUSICOMPRESS = new Guid((short)AudioEncoding.WAVE_FORMAT_SOUNDSPACE_MUSICOMPRESS & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>
|
||||
/// Advanced Audio Coding (AAC) audio in Audio Data Transport Stream (ADTS) format.
|
||||
/// The format block is a WAVEFORMATEX structure with wFormatTag equal to WAVE_FORMAT_MPEG_ADTS_AAC.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The WAVEFORMATEX structure specifies the core AAC-LC sample rate and number of channels,
|
||||
/// prior to applying spectral band replication (SBR) or parametric stereo (PS) tools, if present.
|
||||
/// No additional data is required after the WAVEFORMATEX structure.
|
||||
/// </remarks>
|
||||
/// <see>http://msdn.microsoft.com/en-us/library/dd317599%28VS.85%29.aspx</see>
|
||||
public static readonly Guid MPEG_ADTS_AAC = new Guid((short)AudioEncoding.MPEG_ADTS_AAC & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>MPEG_RAW_AAC</summary>
|
||||
/// <remarks>Source wmCodec.h</remarks>
|
||||
public static readonly Guid MPEG_RAW_AAC = new Guid((short)AudioEncoding.MPEG_RAW_AAC & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>
|
||||
/// MPEG-4 audio transport stream with a synchronization layer (LOAS) and a multiplex layer (LATM).
|
||||
/// The format block is a WAVEFORMATEX structure with wFormatTag equal to WAVE_FORMAT_MPEG_LOAS.
|
||||
/// See <see href="http://msdn.microsoft.com/en-us/library/dd317599%28VS.85%29.aspx"/>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The WAVEFORMATEX structure specifies the core AAC-LC sample rate and number of channels,
|
||||
/// prior to applying spectral SBR or PS tools, if present.
|
||||
/// No additional data is required after the WAVEFORMATEX structure.
|
||||
/// </remarks>
|
||||
public static readonly Guid MPEG_LOAS = new Guid((short)AudioEncoding.MPEG_LOAS & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>NOKIA_MPEG_ADTS_AAC</summary>
|
||||
/// <remarks>Source wmCodec.h</remarks>
|
||||
public static readonly Guid NOKIA_MPEG_ADTS_AAC = new Guid((short)AudioEncoding.NOKIA_MPEG_ADTS_AAC & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>NOKIA_MPEG_RAW_AAC</summary>
|
||||
/// <remarks>Source wmCodec.h</remarks>
|
||||
public static readonly Guid NOKIA_MPEG_RAW_AAC = new Guid((short)AudioEncoding.NOKIA_MPEG_RAW_AAC & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>VODAFONE_MPEG_ADTS_AAC</summary>
|
||||
/// <remarks>Source wmCodec.h</remarks>
|
||||
public static readonly Guid VODAFONE_MPEG_ADTS_AAC = new Guid((short)AudioEncoding.VODAFONE_MPEG_ADTS_AAC & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>VODAFONE_MPEG_RAW_AAC</summary>
|
||||
/// <remarks>Source wmCodec.h</remarks>
|
||||
public static readonly Guid VODAFONE_MPEG_RAW_AAC = new Guid((short)AudioEncoding.VODAFONE_MPEG_RAW_AAC & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>
|
||||
/// High-Efficiency Advanced Audio Coding (HE-AAC) stream.
|
||||
/// The format block is an HEAACWAVEFORMAT structure. See <see href="http://msdn.microsoft.com/en-us/library/dd317599%28VS.85%29.aspx"/>.
|
||||
/// </summary>
|
||||
public static readonly Guid MPEG_HEAAC = new Guid((short)AudioEncoding.MPEG_HEAAC & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_DVM</summary>
|
||||
public static readonly Guid WAVE_FORMAT_DVM = new Guid((short)AudioEncoding.WAVE_FORMAT_DVM & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
// others - not from MS headers
|
||||
/// <summary>WAVE_FORMAT_VORBIS1 "Og" Original stream compatible</summary>
|
||||
public static readonly Guid Vorbis1 = new Guid((short)AudioEncoding.Vorbis1 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_VORBIS2 "Pg" Have independent header</summary>
|
||||
public static readonly Guid Vorbis2 = new Guid((short)AudioEncoding.Vorbis2 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_VORBIS3 "Qg" Have no codebook header</summary>
|
||||
public static readonly Guid Vorbis3 = new Guid((short)AudioEncoding.Vorbis3 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_VORBIS1P "og" Original stream compatible</summary>
|
||||
public static readonly Guid Vorbis1P = new Guid((short)AudioEncoding.Vorbis1P & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_VORBIS2P "pg" Have independent headere</summary>
|
||||
public static readonly Guid Vorbis2P = new Guid((short)AudioEncoding.Vorbis2P & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_VORBIS3P "qg" Have no codebook header</summary>
|
||||
public static readonly Guid Vorbis3P = new Guid((short)AudioEncoding.Vorbis3P & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>
|
||||
/// Raw AAC1
|
||||
/// </summary>
|
||||
public static readonly Guid WAVE_FORMAT_RAW_AAC1 = new Guid((short)AudioEncoding.WAVE_FORMAT_RAW_AAC1 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>
|
||||
/// Windows Media Audio Voice (WMA Voice)
|
||||
/// </summary>
|
||||
public static readonly Guid WAVE_FORMAT_WMAVOICE9 = new Guid((short)AudioEncoding.WAVE_FORMAT_WMAVOICE9 & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>Extensible</summary>
|
||||
public static readonly Guid Extensible = new Guid((short)AudioEncoding.Extensible & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>WAVE_FORMAT_DEVELOPMENT</summary>
|
||||
public static readonly Guid WAVE_FORMAT_DEVELOPMENT = new Guid((short)AudioEncoding.WAVE_FORMAT_DEVELOPMENT & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
/// <summary>
|
||||
/// FLAC
|
||||
/// </summary>
|
||||
public static readonly Guid WAVE_FORMAT_FLAC = new Guid((short)AudioEncoding.WAVE_FORMAT_FLAC & 0x0000FFFF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);
|
||||
|
||||
// ReSharper restore InconsistentNaming
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d6a03d1238626a94cbad8f83782f22eb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,102 @@
|
||||
using System;
|
||||
|
||||
namespace CSCore
|
||||
{
|
||||
/// <summary>
|
||||
/// Channelmask used by <see cref="WaveFormatExtensible" />. For more information see
|
||||
/// http://msdn.microsoft.com/en-us/library/windows/desktop/dd757714(v=vs.85).aspx
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum ChannelMask
|
||||
{
|
||||
/// <summary>
|
||||
/// Front left speaker.
|
||||
/// </summary>
|
||||
SpeakerFrontLeft = 0x1,
|
||||
|
||||
/// <summary>
|
||||
/// Front right speaker.
|
||||
/// </summary>
|
||||
SpeakerFrontRight = 0x2,
|
||||
|
||||
/// <summary>
|
||||
/// Front center speaker.
|
||||
/// </summary>
|
||||
SpeakerFrontCenter = 0x4,
|
||||
|
||||
/// <summary>
|
||||
/// Low frequency speaker.
|
||||
/// </summary>
|
||||
SpeakerLowFrequency = 0x8,
|
||||
|
||||
/// <summary>
|
||||
/// Back left speaker.
|
||||
/// </summary>
|
||||
SpeakerBackLeft = 0x10,
|
||||
|
||||
/// <summary>
|
||||
/// Back right speaker.
|
||||
/// </summary>
|
||||
SpeakerBackRight = 0x20,
|
||||
|
||||
/// <summary>
|
||||
/// Front left of center speaker.
|
||||
/// </summary>
|
||||
SpeakerFrontLeftOfCenter = 0x40,
|
||||
|
||||
/// <summary>
|
||||
/// Front right of center speaker.
|
||||
/// </summary>
|
||||
SpeakerFrontRightOfCenter = 0x80,
|
||||
|
||||
/// <summary>
|
||||
/// Back center speaker.
|
||||
/// </summary>
|
||||
SpeakerBackCenter = 0x100,
|
||||
|
||||
/// <summary>
|
||||
/// Side left speaker.
|
||||
/// </summary>
|
||||
SpeakerSideLeft = 0x200,
|
||||
|
||||
/// <summary>
|
||||
/// Side right speaker.
|
||||
/// </summary>
|
||||
SpeakerSideRight = 0x400,
|
||||
|
||||
/// <summary>
|
||||
/// Top center speaker.
|
||||
/// </summary>
|
||||
SpeakerTopCenter = 0x800,
|
||||
|
||||
/// <summary>
|
||||
/// Top front left speaker.
|
||||
/// </summary>
|
||||
SpeakerTopFrontLeft = 0x1000,
|
||||
|
||||
/// <summary>
|
||||
/// Top front center speaker.
|
||||
/// </summary>
|
||||
SpeakerTopFrontCenter = 0x2000,
|
||||
|
||||
/// <summary>
|
||||
/// Top front right speaker.
|
||||
/// </summary>
|
||||
SpeakerTopFrontRight = 0x4000,
|
||||
|
||||
/// <summary>
|
||||
/// Top back left speaker.
|
||||
/// </summary>
|
||||
SpeakerTopBackLeft = 0x8000,
|
||||
|
||||
/// <summary>
|
||||
/// Top back center speaker.
|
||||
/// </summary>
|
||||
SpeakerTopBackCenter = 0x10000,
|
||||
|
||||
/// <summary>
|
||||
/// Top back right speaker.
|
||||
/// </summary>
|
||||
SpeakerTopBackRight = 0x20000
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4903a9a437074914ebd63a1298f684e7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
|
||||
namespace CSCore
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides a few basic extensions.
|
||||
/// </summary>
|
||||
public static class Extensions
|
||||
{
|
||||
// ReSharper disable once InconsistentNaming
|
||||
internal static bool IsPCM(this WaveFormat waveFormat)
|
||||
{
|
||||
if (waveFormat == null)
|
||||
throw new ArgumentNullException("waveFormat");
|
||||
if (waveFormat is WaveFormatExtensible)
|
||||
return ((WaveFormatExtensible) waveFormat).SubFormat == AudioSubTypes.Pcm;
|
||||
return waveFormat.WaveFormatTag == AudioEncoding.Pcm;
|
||||
}
|
||||
|
||||
internal static bool IsIeeeFloat(this WaveFormat waveFormat)
|
||||
{
|
||||
if (waveFormat == null)
|
||||
throw new ArgumentNullException("waveFormat");
|
||||
if (waveFormat is WaveFormatExtensible)
|
||||
return ((WaveFormatExtensible) waveFormat).SubFormat == AudioSubTypes.IeeeFloat;
|
||||
return waveFormat.WaveFormatTag == AudioEncoding.IeeeFloat;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3cd34287d9d0abb43816d791896fe275
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
|
||||
namespace CSCore
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the base for all audio streams.
|
||||
/// </summary>
|
||||
public interface IAudioSource : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the <see cref="IAudioSource" /> supports seeking.
|
||||
/// </summary>
|
||||
bool CanSeek { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="WaveFormat" /> of the waveform-audio data.
|
||||
/// </summary>
|
||||
WaveFormat WaveFormat { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the current position. The unit of this property depends on the implementation of this interface. Some
|
||||
/// implementations may not support this property.
|
||||
/// </summary>
|
||||
long Position { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the length of the waveform-audio data. The unit of this property depends on the implementation of this
|
||||
/// interface. Some implementations may not support this property.
|
||||
/// </summary>
|
||||
long Length { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b50967e9192a7cf4284b0ffad20718f2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,27 @@
|
||||
namespace CSCore
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a generic base for all readable audio streams.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the provided audio data.</typeparam>
|
||||
public interface IReadableAudioSource<in T> : IAudioSource
|
||||
{
|
||||
/// <summary>
|
||||
/// Reads a sequence of elements from the <see cref="IReadableAudioSource{T}" /> and advances the position within the
|
||||
/// stream by the
|
||||
/// number of elements read.
|
||||
/// </summary>
|
||||
/// <param name="buffer">
|
||||
/// An array of elements. When this method returns, the <paramref name="buffer" /> contains the specified
|
||||
/// array of elements with the values between <paramref name="offset" /> and (<paramref name="offset" /> +
|
||||
/// <paramref name="count" /> - 1) replaced by the elements read from the current source.
|
||||
/// </param>
|
||||
/// <param name="offset">
|
||||
/// The zero-based offset in the <paramref name="buffer" /> at which to begin storing the data
|
||||
/// read from the current stream.
|
||||
/// </param>
|
||||
/// <param name="count">The maximum number of elements to read from the current source.</param>
|
||||
/// <returns>The total number of elements read into the buffer.</returns>
|
||||
int Read(T[] buffer, int offset, int count);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 783f914c3776f4041b78c8639efe832f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,31 @@
|
||||
namespace CSCore
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the base for all audio streams which provide raw byte data.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Compared to the <see cref="ISampleSource" />, the <see cref="IWaveSource" /> provides raw bytes instead of samples.
|
||||
/// That means that the <see cref="IAudioSource.Position" /> and the <see cref="IAudioSource.Position" /> properties are
|
||||
/// expressed in bytes.
|
||||
/// Also the <see cref="IReadableAudioSource{T}.Read" /> method provides samples instead of raw bytes.
|
||||
/// </remarks>
|
||||
public interface IWaveSource : IReadableAudioSource<byte>
|
||||
{
|
||||
/*/// <summary>
|
||||
/// Reads a sequence of bytes from the <see cref="IWaveSource" /> and advances the position within the stream by the
|
||||
/// number of bytes read.
|
||||
/// </summary>
|
||||
/// <param name="buffer">
|
||||
/// An array of bytes. When this method returns, the <paramref name="buffer" /> contains the specified
|
||||
/// byte array with the values between <paramref name="offset" /> and (<paramref name="offset" /> +
|
||||
/// <paramref name="count" /> - 1) replaced by the bytes read from the current source.
|
||||
/// </param>
|
||||
/// <param name="offset">
|
||||
/// The zero-based byte offset in the <paramref name="buffer" /> at which to begin storing the data
|
||||
/// read from the current stream.
|
||||
/// </param>
|
||||
/// <param name="count">The maximum number of bytes to read from the current source.</param>
|
||||
/// <returns>The total number of bytes read into the buffer.</returns>
|
||||
int Read(byte[] buffer, int offset, int count);*/
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4bcb558a4ff125b4e8078864d6b39531
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,16 @@
|
||||
namespace CSCore
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides the <see cref="Write" /> method.
|
||||
/// </summary>
|
||||
public interface IWriteable
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to write down raw byte data.
|
||||
/// </summary>
|
||||
/// <param name="buffer">Byte array which contains the data to write down.</param>
|
||||
/// <param name="offset">Zero-based offset in the <paramref name="buffer" />.</param>
|
||||
/// <param name="count">Number of bytes to write.</param>
|
||||
void Write(byte[] buffer, int offset, int count);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 49b581aba0acb904897782786821c602
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,274 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace CSCore
|
||||
{
|
||||
// ReSharper disable ConvertToAutoProperty
|
||||
/// <summary>
|
||||
/// Defines the format of waveform-audio data.
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||
public class WaveFormat : ICloneable, IEquatable<WaveFormat>
|
||||
{
|
||||
private AudioEncoding _encoding;
|
||||
private short _channels;
|
||||
private int _sampleRate;
|
||||
private int _bytesPerSecond;
|
||||
|
||||
private short _blockAlign;
|
||||
private short _bitsPerSample;
|
||||
private short _extraSize;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of channels in the waveform-audio data. Mono data uses one channel and stereo data uses two
|
||||
/// channels.
|
||||
/// </summary>
|
||||
public virtual int Channels
|
||||
{
|
||||
get { return _channels; }
|
||||
protected internal set
|
||||
{
|
||||
_channels = (short) value;
|
||||
UpdateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the sample rate, in samples per second (hertz).
|
||||
/// </summary>
|
||||
public virtual int SampleRate
|
||||
{
|
||||
get { return _sampleRate; }
|
||||
protected internal set
|
||||
{
|
||||
_sampleRate = value;
|
||||
UpdateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the required average data transfer rate, in bytes per second. For example, 16-bit stereo at 44.1 kHz has an
|
||||
/// average data rate of 176,400 bytes per second (2 channels — 2 bytes per sample per channel — 44,100 samples per
|
||||
/// second).
|
||||
/// </summary>
|
||||
public virtual int BytesPerSecond
|
||||
{
|
||||
get { return _bytesPerSecond; }
|
||||
protected internal set { _bytesPerSecond = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the block alignment, in bytes. The block alignment is the minimum atomic unit of data. For PCM data, the block
|
||||
/// alignment is the number of bytes used by a single sample, including data for both channels if the data is stereo.
|
||||
/// For example, the block alignment for 16-bit stereo PCM is 4 bytes (2 channels x 2 bytes per sample).
|
||||
/// </summary>
|
||||
public virtual int BlockAlign
|
||||
{
|
||||
get { return _blockAlign; }
|
||||
protected internal set { _blockAlign = (short) value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of bits, used to store one sample.
|
||||
/// </summary>
|
||||
public virtual int BitsPerSample
|
||||
{
|
||||
get { return _bitsPerSample; }
|
||||
protected internal set
|
||||
{
|
||||
_bitsPerSample = (short) value;
|
||||
UpdateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the size (in bytes) of extra information. This value is mainly used for marshalling.
|
||||
/// </summary>
|
||||
public virtual int ExtraSize
|
||||
{
|
||||
get { return _extraSize; }
|
||||
protected internal set { _extraSize = (short) value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of bytes, used to store one sample.
|
||||
/// </summary>
|
||||
public virtual int BytesPerSample
|
||||
{
|
||||
get { return BitsPerSample / 8; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of bytes, used to store one block. This value equals <see cref="BytesPerSample" /> multiplied with
|
||||
/// <see cref="Channels" />.
|
||||
/// </summary>
|
||||
public virtual int BytesPerBlock
|
||||
{
|
||||
get { return BytesPerSample * Channels; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the waveform-audio format type.
|
||||
/// </summary>
|
||||
public virtual AudioEncoding WaveFormatTag
|
||||
{
|
||||
get { return _encoding; }
|
||||
protected internal set { _encoding = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WaveFormat" /> class with a sample rate of 44100 Hz, bits per sample
|
||||
/// of 16 bit, 2 channels and PCM as the format type.
|
||||
/// </summary>
|
||||
public WaveFormat()
|
||||
: this(44100, 16, 2)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WaveFormat" /> class with PCM as the format type.
|
||||
/// </summary>
|
||||
/// <param name="sampleRate">Samples per second.</param>
|
||||
/// <param name="bits">Number of bits, used to store one sample.</param>
|
||||
/// <param name="channels">Number of channels in the waveform-audio data.</param>
|
||||
public WaveFormat(int sampleRate, int bits, int channels)
|
||||
: this(sampleRate, bits, channels, AudioEncoding.Pcm)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WaveFormat" /> class.
|
||||
/// </summary>
|
||||
/// <param name="sampleRate">Samples per second.</param>
|
||||
/// <param name="bits">Number of bits, used to store one sample.</param>
|
||||
/// <param name="channels">Number of channels in the waveform-audio data.</param>
|
||||
/// <param name="encoding">Format type or encoding of the wave format.</param>
|
||||
public WaveFormat(int sampleRate, int bits, int channels, AudioEncoding encoding)
|
||||
: this(sampleRate, bits, channels, encoding, 0)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WaveFormat" /> class.
|
||||
/// </summary>
|
||||
/// <param name="sampleRate">Samples per second.</param>
|
||||
/// <param name="bits">Number of bits, used to store one sample.</param>
|
||||
/// <param name="channels">Number of channels in the waveform-audio data.</param>
|
||||
/// <param name="encoding">Format type or encoding of the wave format.</param>
|
||||
/// <param name="extraSize">Size (in bytes) of extra information. This value is mainly used for marshalling.</param>
|
||||
public WaveFormat(int sampleRate, int bits, int channels, AudioEncoding encoding, int extraSize)
|
||||
{
|
||||
if (sampleRate < 1)
|
||||
throw new ArgumentOutOfRangeException("sampleRate");
|
||||
if (bits < 0)
|
||||
throw new ArgumentOutOfRangeException("bits");
|
||||
if (channels < 1)
|
||||
throw new ArgumentOutOfRangeException("channels", "Number of channels has to be bigger than 0.");
|
||||
|
||||
_sampleRate = sampleRate;
|
||||
_bitsPerSample = (short) bits;
|
||||
_channels = (short) channels;
|
||||
_encoding = encoding;
|
||||
_extraSize = (short) extraSize;
|
||||
|
||||
// ReSharper disable once DoNotCallOverridableMethodsInConstructor
|
||||
UpdateProperties();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a duration in milliseconds to a duration in bytes.
|
||||
/// </summary>
|
||||
/// <param name="milliseconds">Duration in millisecond to convert to a duration in bytes.</param>
|
||||
/// <returns>Duration in bytes.</returns>
|
||||
public long MillisecondsToBytes(double milliseconds)
|
||||
{
|
||||
var result = (long) ((BytesPerSecond / 1000.0) * milliseconds);
|
||||
result -= result % BlockAlign;
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a duration in bytes to a duration in milliseconds.
|
||||
/// </summary>
|
||||
/// <param name="bytes">Duration in bytes to convert to a duration in milliseconds.</param>
|
||||
/// <returns>Duration in milliseconds.</returns>
|
||||
public double BytesToMilliseconds(long bytes)
|
||||
{
|
||||
bytes -= bytes % BlockAlign;
|
||||
var result = ((bytes / (double) BytesPerSecond) * 1000.0);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether the current object is equal to another object of the same type.
|
||||
/// </summary>
|
||||
/// <param name="other">The <see cref="WaveFormat"/> to compare with this <see cref="WaveFormat"/>.</param>
|
||||
/// <returns>true if the current object is equal to the other parameter; otherwise, false.</returns>
|
||||
public virtual bool Equals(WaveFormat other)
|
||||
{
|
||||
return Channels == other.Channels &&
|
||||
SampleRate == other.SampleRate &&
|
||||
BytesPerSecond == other.BytesPerSecond &&
|
||||
BlockAlign == other.BlockAlign &&
|
||||
BitsPerSample == other.BitsPerSample &&
|
||||
ExtraSize == other.ExtraSize &&
|
||||
WaveFormatTag == other.WaveFormatTag;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string which describes the <see cref="WaveFormat" />.
|
||||
/// </summary>
|
||||
/// <returns>A string which describes the <see cref="WaveFormat" />.</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return GetInformation().ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="WaveFormat" /> object that is a copy of the current instance.
|
||||
/// </summary>
|
||||
/// <returns>A copy of the current instance.</returns>
|
||||
public virtual object Clone()
|
||||
{
|
||||
return MemberwiseClone(); //since there are value types MemberWiseClone is enough.
|
||||
}
|
||||
|
||||
internal virtual void SetWaveFormatTagInternal(AudioEncoding waveFormatTag)
|
||||
{
|
||||
WaveFormatTag = waveFormatTag;
|
||||
}
|
||||
|
||||
internal virtual void SetBitsPerSampleAndFormatProperties(int bitsPerSample)
|
||||
{
|
||||
BitsPerSample = bitsPerSample;
|
||||
UpdateProperties();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the <see cref="BlockAlign"/>- and the <see cref="BytesPerSecond"/>-property.
|
||||
/// </summary>
|
||||
internal protected virtual void UpdateProperties()
|
||||
{
|
||||
BlockAlign = (BitsPerSample / 8) * Channels;
|
||||
BytesPerSecond = BlockAlign * SampleRate;
|
||||
}
|
||||
|
||||
[DebuggerStepThrough]
|
||||
private StringBuilder GetInformation()
|
||||
{
|
||||
var builder = new StringBuilder();
|
||||
builder.Append("ChannelsAvailable: " + Channels);
|
||||
builder.Append("|SampleRate: " + SampleRate);
|
||||
builder.Append("|Bps: " + BytesPerSecond);
|
||||
builder.Append("|BlockAlign: " + BlockAlign);
|
||||
builder.Append("|BitsPerSample: " + BitsPerSample);
|
||||
builder.Append("|Encoding: " + _encoding);
|
||||
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
|
||||
// ReSharper restore ConvertToAutoProperty
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5d3c9bf63affc0f4fb0921bad33ffb91
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,203 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace CSCore
|
||||
{
|
||||
//http://msdn.microsoft.com/en-us/library/windows/hardware/ff536383(v=vs.85).aspx
|
||||
//http://msdn.microsoft.com/en-us/library/windows/hardware/gg463006.aspx
|
||||
/// <summary>
|
||||
/// Defines the format of waveform-audio data for formats having more than two channels or higher sample resolutions
|
||||
/// than allowed by <see cref="WaveFormat" />.
|
||||
/// Can be used to define any format that can be defined by <see cref="WaveFormat" />.
|
||||
/// For more information see <see href="http://msdn.microsoft.com/en-us/library/windows/hardware/gg463006.aspx" /> and
|
||||
/// <see href="http://msdn.microsoft.com/en-us/library/windows/hardware/ff536383(v=vs.85).aspx" />.
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 2, CharSet = CharSet.Ansi)]
|
||||
public class WaveFormatExtensible : WaveFormat
|
||||
{
|
||||
internal const int WaveFormatExtensibleExtraSize = 22; //2(WORD) + 4(DWORD) + 16(GUID)
|
||||
|
||||
private short _samplesUnion;
|
||||
|
||||
private ChannelMask _channelMask;
|
||||
private Guid _subFormat;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the SubType-Guid of a <paramref name="waveFormat" />. If the specified <paramref name="waveFormat" /> does
|
||||
/// not contain a SubType-Guid, the <see cref="WaveFormat.WaveFormatTag" /> gets converted to the equal SubType-Guid
|
||||
/// using the <see cref="AudioSubTypes.SubTypeFromEncoding" /> method.
|
||||
/// </summary>
|
||||
/// <param name="waveFormat"><see cref="WaveFormat" /> which gets used to determine the SubType-Guid.</param>
|
||||
/// <returns>SubType-Guid of the specified <paramref name="waveFormat" />.</returns>
|
||||
public static Guid SubTypeFromWaveFormat(WaveFormat waveFormat)
|
||||
{
|
||||
if (waveFormat == null)
|
||||
throw new ArgumentNullException("waveFormat");
|
||||
if (waveFormat is WaveFormatExtensible)
|
||||
return ((WaveFormatExtensible) waveFormat).SubFormat;
|
||||
return AudioSubTypes.SubTypeFromEncoding(waveFormat.WaveFormatTag);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of bits of precision in the signal.
|
||||
/// Usually equal to <see cref="WaveFormat.BitsPerSample" />. However, <see cref="WaveFormat.BitsPerSample" /> is the
|
||||
/// container size and must be a multiple of 8, whereas <see cref="ValidBitsPerSample" /> can be any value not
|
||||
/// exceeding the container size. For example, if the format uses 20-bit samples,
|
||||
/// <see cref="WaveFormat.BitsPerSample" /> must be at least 24, but <see cref="ValidBitsPerSample" /> is 20.
|
||||
/// </summary>
|
||||
public int ValidBitsPerSample
|
||||
{
|
||||
get { return _samplesUnion; }
|
||||
internal protected set { _samplesUnion = (short) value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of samples contained in one compressed block of audio data. This value is used in buffer
|
||||
/// estimation. This value is used with compressed formats that have a fixed number of samples within each block. This
|
||||
/// value can be set to 0 if a variable number of samples is contained in each block of compressed audio data. In this
|
||||
/// case, buffer estimation and position information needs to be obtained in other ways.
|
||||
/// </summary>
|
||||
public int SamplesPerBlock
|
||||
{
|
||||
get { return _samplesUnion; }
|
||||
internal protected set { _samplesUnion = (short) value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a bitmask specifying the assignment of channels in the stream to speaker positions.
|
||||
/// </summary>
|
||||
public ChannelMask ChannelMask
|
||||
{
|
||||
get { return _channelMask; }
|
||||
internal protected set { _channelMask = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Subformat of the data, such as <see cref="AudioSubTypes.Pcm" />. The subformat information is similar to
|
||||
/// that provided by the tag in the <see cref="WaveFormat" /> class's <see cref="WaveFormat.WaveFormatTag" /> member.
|
||||
/// </summary>
|
||||
public Guid SubFormat
|
||||
{
|
||||
get { return _subFormat; }
|
||||
internal protected set { _subFormat = value; }
|
||||
}
|
||||
|
||||
internal WaveFormatExtensible()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WaveFormatExtensible" /> class.
|
||||
/// </summary>
|
||||
/// <param name="sampleRate">
|
||||
/// Samplerate of the waveform-audio. This value will get applied to the
|
||||
/// <see cref="WaveFormat.SampleRate" /> property.
|
||||
/// </param>
|
||||
/// <param name="bits">
|
||||
/// Bits per sample of the waveform-audio. This value will get applied to the
|
||||
/// <see cref="WaveFormat.BitsPerSample" /> property and the <see cref="ValidBitsPerSample" /> property.
|
||||
/// </param>
|
||||
/// <param name="channels">
|
||||
/// Number of channels of the waveform-audio. This value will get applied to the
|
||||
/// <see cref="WaveFormat.Channels" /> property.
|
||||
/// </param>
|
||||
/// <param name="subFormat">Subformat of the data. This value will get applied to the <see cref="SubFormat" /> property.</param>
|
||||
public WaveFormatExtensible(int sampleRate, int bits, int channels, Guid subFormat)
|
||||
: base(sampleRate, bits, channels, AudioEncoding.Extensible, WaveFormatExtensibleExtraSize)
|
||||
{
|
||||
_samplesUnion = (short) bits;
|
||||
_subFormat = SubTypeFromWaveFormat(this);
|
||||
int cm = 0;
|
||||
for (int i = 0; i < channels; i++)
|
||||
{
|
||||
cm |= (1 << i);
|
||||
}
|
||||
|
||||
_channelMask = (ChannelMask) cm;
|
||||
_subFormat = subFormat;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WaveFormatExtensible" /> class.
|
||||
/// </summary>
|
||||
/// <param name="sampleRate">
|
||||
/// Samplerate of the waveform-audio. This value will get applied to the
|
||||
/// <see cref="WaveFormat.SampleRate" /> property.
|
||||
/// </param>
|
||||
/// <param name="bits">
|
||||
/// Bits per sample of the waveform-audio. This value will get applied to the
|
||||
/// <see cref="WaveFormat.BitsPerSample" /> property and the <see cref="ValidBitsPerSample" /> property.
|
||||
/// </param>
|
||||
/// <param name="channels">
|
||||
/// Number of channels of the waveform-audio. This value will get applied to the
|
||||
/// <see cref="WaveFormat.Channels" /> property.
|
||||
/// </param>
|
||||
/// <param name="subFormat">Subformat of the data. This value will get applied to the <see cref="SubFormat" /> property.</param>
|
||||
/// <param name="channelMask">
|
||||
/// Bitmask specifying the assignment of channels in the stream to speaker positions. Thie value
|
||||
/// will get applied to the <see cref="ChannelMask" /> property.
|
||||
/// </param>
|
||||
public WaveFormatExtensible(int sampleRate, int bits, int channels, Guid subFormat, ChannelMask channelMask)
|
||||
: this(sampleRate, bits, channels, subFormat)
|
||||
{
|
||||
Array totalChannelMaskValues = Enum.GetValues(typeof (ChannelMask));
|
||||
int valuesSet = 0;
|
||||
for (int i = 0; i < totalChannelMaskValues.Length; i++)
|
||||
{
|
||||
if ((channelMask & (ChannelMask) totalChannelMaskValues.GetValue(i)) ==
|
||||
(ChannelMask) totalChannelMaskValues.GetValue(i))
|
||||
valuesSet++;
|
||||
}
|
||||
|
||||
if (channels != valuesSet)
|
||||
throw new ArgumentException("Channels has to equal the set flags in the channelmask.");
|
||||
|
||||
_channelMask = channelMask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the <see cref="WaveFormatExtensible" /> instance to a raw <see cref="WaveFormat" /> instance by converting
|
||||
/// the <see cref="SubFormat" /> to the equal <see cref="WaveFormat.WaveFormatTag" />.
|
||||
/// </summary>
|
||||
/// <returns>A simple <see cref="WaveFormat"/> instance.</returns>
|
||||
public WaveFormat ToWaveFormat()
|
||||
{
|
||||
return new WaveFormat(SampleRate, BitsPerSample, Channels, AudioSubTypes.EncodingFromSubType(SubFormat));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="WaveFormat" /> object that is a copy of the current instance.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A copy of the current instance.
|
||||
/// </returns>
|
||||
public override object Clone()
|
||||
{
|
||||
//var waveFormat = new WaveFormatExtensible(SampleRate, BitsPerSample, Channels, SubFormat, ChannelMask);
|
||||
//waveFormat._samplesUnion = _samplesUnion;
|
||||
//return waveFormat;
|
||||
return MemberwiseClone();
|
||||
}
|
||||
|
||||
internal override void SetWaveFormatTagInternal(AudioEncoding waveFormatTag)
|
||||
{
|
||||
SubFormat = AudioSubTypes.SubTypeFromEncoding(waveFormatTag);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string which describes the <see cref="WaveFormatExtensible" />.
|
||||
/// </summary>
|
||||
/// <returns>A string which describes the <see cref="WaveFormatExtensible" />.</returns>
|
||||
[DebuggerStepThrough]
|
||||
public override string ToString()
|
||||
{
|
||||
var stringBuilder = new StringBuilder(base.ToString());
|
||||
stringBuilder.Append("|SubFormat: " + SubFormat);
|
||||
stringBuilder.Append("|ChannelMask: " + ChannelMask);
|
||||
return stringBuilder.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bd1311d5300bf934aa43ba92b819427b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,362 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace CSCore.Codecs.WAV
|
||||
{
|
||||
/// <summary>
|
||||
/// Encoder for wave files.
|
||||
/// </summary>
|
||||
public class WaveWriter : IDisposable, IWriteable
|
||||
{
|
||||
private readonly WaveFormat _waveFormat;
|
||||
|
||||
private readonly long _waveStartPosition;
|
||||
private int _dataLength;
|
||||
private bool _isDisposed;
|
||||
private Stream _stream;
|
||||
private BinaryWriter _writer;
|
||||
private bool _isDisposing;
|
||||
|
||||
private readonly bool _closeStream;
|
||||
|
||||
/// <summary>
|
||||
/// Signals if the object has already been disposed
|
||||
/// </summary>
|
||||
public bool IsDisposed
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isDisposed;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Signals if the object is in a disposing state
|
||||
/// </summary>
|
||||
public bool IsDisposing
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isDisposing;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WaveWriter" /> class.
|
||||
/// </summary>
|
||||
/// <param name="fileName">Filename of the destination file. This filename should typically end with the .wav extension.</param>
|
||||
/// <param name="waveFormat">
|
||||
/// Format of the waveform-audio data. Note that the <see cref="WaveWriter" /> won't convert any
|
||||
/// data.
|
||||
/// </param>
|
||||
public WaveWriter(string fileName, WaveFormat waveFormat)
|
||||
: this(File.OpenWrite(fileName), waveFormat)
|
||||
{
|
||||
_closeStream = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WaveWriter" /> class.
|
||||
/// </summary>
|
||||
/// <param name="stream">Destination stream which should be used to store the</param>
|
||||
/// <param name="waveFormat">
|
||||
/// Format of the waveform-audio data. Note that the <see cref="WaveWriter" /> won't convert any
|
||||
/// data.
|
||||
/// </param>
|
||||
public WaveWriter(Stream stream, WaveFormat waveFormat)
|
||||
{
|
||||
if (stream == null)
|
||||
throw new ArgumentNullException("stream");
|
||||
if (!stream.CanWrite)
|
||||
throw new ArgumentException("Stream not writeable.", "stream");
|
||||
if (!stream.CanSeek)
|
||||
throw new ArgumentException("Stream not seekable.", "stream");
|
||||
|
||||
_isDisposing = false;
|
||||
_isDisposed = false;
|
||||
_stream = stream;
|
||||
_waveStartPosition = stream.Position;
|
||||
_writer = new BinaryWriter(stream);
|
||||
for (int i = 0; i < 44; i++)
|
||||
{
|
||||
_writer.Write((byte) 0);
|
||||
}
|
||||
_waveFormat = waveFormat;
|
||||
|
||||
WriteHeader();
|
||||
|
||||
_closeStream = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Disposes the <see cref="WaveWriter" /> and writes down the wave header.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes down all audio data of the <see cref="IWaveSource" /> to a file.
|
||||
/// </summary>
|
||||
/// <param name="filename">The filename.</param>
|
||||
/// <param name="source">The source to write down to the file.</param>
|
||||
/// <param name="deleteFileIfAlreadyExists">if set to <c>true</c> the file will be overritten if it already exists.</param>
|
||||
/// <param name="maxlength">The maximum number of bytes to write. Use -1 to write an infinte number of bytes.</param>
|
||||
/// <remarks>
|
||||
/// This method is obsolete. Use the <see cref="Extensions.WriteToWaveStream" /> extension instead.
|
||||
/// </remarks>
|
||||
[Obsolete("Use the Extensions.WriteToWaveStream extension instead.")]
|
||||
public static void WriteToFile(string filename, IWaveSource source, bool deleteFileIfAlreadyExists,
|
||||
int maxlength = -1)
|
||||
{
|
||||
if (deleteFileIfAlreadyExists && File.Exists(filename))
|
||||
File.Delete(filename);
|
||||
|
||||
int r = 0;
|
||||
var buffer = new byte[source.WaveFormat.BytesPerSecond];
|
||||
using (var w = new WaveWriter(filename, source.WaveFormat))
|
||||
{
|
||||
int read;
|
||||
while ((read = source.Read(buffer, 0, buffer.Length)) > 0)
|
||||
{
|
||||
w.Write(buffer, 0, read);
|
||||
r += read;
|
||||
if (maxlength != -1 && r > maxlength)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encodes a single sample.
|
||||
/// </summary>
|
||||
/// <param name="sample">The sample to encode.</param>
|
||||
public void WriteSample(float sample)
|
||||
{
|
||||
CheckObjectDisposed();
|
||||
|
||||
if (sample < -1 || sample > 1)
|
||||
sample = Math.Max(-1, Math.Min(1, sample));
|
||||
|
||||
if (_waveFormat.IsPCM())
|
||||
{
|
||||
switch (_waveFormat.BitsPerSample)
|
||||
{
|
||||
case 8:
|
||||
Write((byte) (byte.MaxValue * sample));
|
||||
break;
|
||||
case 16:
|
||||
Write((short) (short.MaxValue * sample));
|
||||
break;
|
||||
case 24:
|
||||
byte[] buffer = BitConverter.GetBytes((int)(0x7fffff * sample));
|
||||
Write(new[] {buffer[0], buffer[1], buffer[2]}, 0, 3);
|
||||
break;
|
||||
case 32:
|
||||
Write((int) (int.MaxValue * sample));
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new InvalidOperationException("Invalid Waveformat",
|
||||
new InvalidOperationException("Invalid BitsPerSample while using PCM encoding."));
|
||||
}
|
||||
}
|
||||
else if (_waveFormat.IsIeeeFloat())
|
||||
Write(sample);
|
||||
else if (_waveFormat.WaveFormatTag == AudioEncoding.Extensible && _waveFormat.BitsPerSample == 32)
|
||||
Write(UInt16.MaxValue * (int)sample);
|
||||
else
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"Invalid Waveformat: Waveformat has to be PCM[8, 16, 24, 32] or IeeeFloat[32]");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encodes multiple samples.
|
||||
/// </summary>
|
||||
/// <param name="samples">Float array which contains the samples to encode.</param>
|
||||
/// <param name="offset">Zero-based offset in the <paramref name="samples" /> array.</param>
|
||||
/// <param name="count">Number of samples to encode.</param>
|
||||
public void WriteSamples(float[] samples, int offset, int count)
|
||||
{
|
||||
CheckObjectDisposed();
|
||||
|
||||
for (int i = offset; i < offset + count; i++)
|
||||
{
|
||||
WriteSample(samples[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encodes raw data in the form of a byte array.
|
||||
/// </summary>
|
||||
/// <param name="buffer">Byte array which contains the data to encode.</param>
|
||||
/// <param name="offset">Zero-based offset in the <paramref name="buffer" />.</param>
|
||||
/// <param name="count">Number of bytes to encode.</param>
|
||||
public void Write(byte[] buffer, int offset, int count)
|
||||
{
|
||||
CheckObjectDisposed();
|
||||
|
||||
_stream.Write(buffer, offset, count);
|
||||
_dataLength += count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes down a single byte.
|
||||
/// </summary>
|
||||
/// <param name="value">Byte to write down.</param>
|
||||
public void Write(byte value)
|
||||
{
|
||||
CheckObjectDisposed();
|
||||
|
||||
_writer.Write(value);
|
||||
_dataLength++;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes down a single 16 bit integer value.
|
||||
/// </summary>
|
||||
/// <param name="value">Value to write down.</param>
|
||||
public void Write(short value)
|
||||
{
|
||||
CheckObjectDisposed();
|
||||
|
||||
_writer.Write(value);
|
||||
_dataLength += 2;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes down a single 32 bit integer value.
|
||||
/// </summary>
|
||||
/// <param name="value">Value to write down.</param>
|
||||
public void Write(int value)
|
||||
{
|
||||
CheckObjectDisposed();
|
||||
|
||||
_writer.Write(value);
|
||||
_dataLength += 4;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes down a single 32 bit float value.
|
||||
/// </summary>
|
||||
/// <param name="value">Value to write down.</param>
|
||||
public void Write(float value)
|
||||
{
|
||||
CheckObjectDisposed();
|
||||
|
||||
_writer.Write(value);
|
||||
_dataLength += 4;
|
||||
}
|
||||
|
||||
private void WriteHeader()
|
||||
{
|
||||
_writer.Flush();
|
||||
|
||||
long currentPosition = _stream.Position;
|
||||
_stream.Position = _waveStartPosition;
|
||||
|
||||
WriteRiffHeader();
|
||||
WriteFmtChunk();
|
||||
WriteDataChunk();
|
||||
|
||||
_writer.Flush();
|
||||
|
||||
_stream.Position = currentPosition;
|
||||
}
|
||||
|
||||
private void WriteRiffHeader()
|
||||
{
|
||||
_writer.Write(Encoding.UTF8.GetBytes("RIFF"));
|
||||
_writer.Write((int) (_stream.Length - 8));
|
||||
_writer.Write(Encoding.UTF8.GetBytes("WAVE"));
|
||||
}
|
||||
|
||||
private void WriteFmtChunk()
|
||||
{
|
||||
AudioEncoding tag = _waveFormat.WaveFormatTag;
|
||||
if (tag == AudioEncoding.Extensible && _waveFormat is WaveFormatExtensible)
|
||||
tag = AudioSubTypes.EncodingFromSubType((_waveFormat as WaveFormatExtensible).SubFormat);
|
||||
|
||||
_writer.Write(Encoding.UTF8.GetBytes("fmt "));
|
||||
_writer.Write((int)16);
|
||||
_writer.Write((short) tag);
|
||||
_writer.Write((short)_waveFormat.Channels);
|
||||
_writer.Write((int)_waveFormat.SampleRate);
|
||||
_writer.Write((int)_waveFormat.BytesPerSecond);
|
||||
_writer.Write((short) _waveFormat.BlockAlign);
|
||||
_writer.Write((short)_waveFormat.BitsPerSample);
|
||||
}
|
||||
|
||||
private void WriteDataChunk()
|
||||
{
|
||||
_writer.Write(Encoding.UTF8.GetBytes("data"));
|
||||
_writer.Write(_dataLength);
|
||||
}
|
||||
|
||||
private void CheckObjectDisposed()
|
||||
{
|
||||
if (_isDisposed)
|
||||
throw new ObjectDisposedException("WaveWriter");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Disposes the <see cref="WaveWriter" /> and writes down the wave header.
|
||||
/// </summary>
|
||||
/// <param name="disposing">
|
||||
/// True to release both managed and unmanaged resources; false to release only unmanaged
|
||||
/// resources.
|
||||
/// </param>
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (_isDisposed) return;
|
||||
|
||||
if (!disposing) return;
|
||||
|
||||
try
|
||||
{
|
||||
_isDisposing = true;
|
||||
WriteHeader();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine("WaveWriter::Dispose: " + ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (_closeStream)
|
||||
{
|
||||
if (_writer != null)
|
||||
{
|
||||
_writer.Close();
|
||||
_writer = null;
|
||||
}
|
||||
|
||||
if (_stream != null)
|
||||
{
|
||||
_stream.Dispose();
|
||||
_stream = null;
|
||||
}
|
||||
}
|
||||
|
||||
_isDisposing = false;
|
||||
}
|
||||
|
||||
|
||||
_isDisposed = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Destructor of the <see cref="WaveWriter" /> which calls the <see cref="Dispose(bool)" /> method.
|
||||
/// </summary>
|
||||
~WaveWriter()
|
||||
{
|
||||
Dispose(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8f3be84641ff7b543b200b146b3e8d37
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,36 @@
|
||||
## NOTE: ##
|
||||
This license does not apply to the [CSCore.Ffmpeg](https://github.com/filoe/cscore/tree/master/CSCore.Ffmpeg) project!
|
||||
|
||||
## Microsoft Public License (Ms-PL) ##
|
||||
|
||||
Microsoft Public License (Ms-PL)
|
||||
|
||||
This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
|
||||
|
||||
#### 1. Definitions ####
|
||||
|
||||
The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.
|
||||
|
||||
A "contribution" is the original software, or any additions or changes to the software.
|
||||
|
||||
A "contributor" is any person that distributes its contribution under this license.
|
||||
|
||||
"Licensed patents" are a contributor's patent claims that read directly on its contribution.
|
||||
|
||||
#### 2. Grant of Rights ####
|
||||
|
||||
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
|
||||
|
||||
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
|
||||
|
||||
#### 3. Conditions and Limitations ####
|
||||
|
||||
(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
|
||||
|
||||
(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
|
||||
|
||||
(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
|
||||
|
||||
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
|
||||
|
||||
(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 31539401d6075c44daf952351a39dafd
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
163
Assets/Photon/PhotonVoice/Code/UtilityScripts/ConnectAndJoin.cs
Normal file
163
Assets/Photon/PhotonVoice/Code/UtilityScripts/ConnectAndJoin.cs
Normal file
@@ -0,0 +1,163 @@
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="ConnectAndJoin.cs" company="Exit Games GmbH">
|
||||
// Part of: Photon Voice Utilities for Unity - Copyright (C) 2018 Exit Games GmbH
|
||||
// </copyright>
|
||||
// <summary>
|
||||
// Simple component to call voiceConnection.ConnectUsingSettings() and get into a Voice room easily.
|
||||
// </summary>
|
||||
// <remarks>
|
||||
// Requires a VoiceConnection component attached to the same GameObject.
|
||||
// </remarks>
|
||||
// <author>developer@exitgames.com</author>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
using Photon.Realtime;
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Photon.Voice.Unity.UtilityScripts
|
||||
{
|
||||
[RequireComponent(typeof(VoiceConnection))]
|
||||
public class ConnectAndJoin : MonoBehaviour, IConnectionCallbacks, IMatchmakingCallbacks
|
||||
{
|
||||
private VoiceConnection voiceConnection;
|
||||
|
||||
public bool RandomRoom = true;
|
||||
|
||||
[SerializeField]
|
||||
private bool autoConnect = true;
|
||||
|
||||
[SerializeField]
|
||||
private bool autoTransmit = true;
|
||||
|
||||
[SerializeField]
|
||||
private bool publishUserId = false;
|
||||
|
||||
public string RoomName;
|
||||
|
||||
private readonly EnterRoomParams enterRoomParams = new EnterRoomParams
|
||||
{
|
||||
RoomOptions = new RoomOptions()
|
||||
};
|
||||
|
||||
public bool IsConnected { get { return this.voiceConnection.Client.IsConnected; } }
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
this.voiceConnection = this.GetComponent<VoiceConnection>();
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
this.voiceConnection.Client.AddCallbackTarget(this);
|
||||
if (this.autoConnect)
|
||||
{
|
||||
this.ConnectNow();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
this.voiceConnection.Client.RemoveCallbackTarget(this);
|
||||
}
|
||||
|
||||
public void ConnectNow()
|
||||
{
|
||||
this.voiceConnection.ConnectUsingSettings();
|
||||
}
|
||||
|
||||
#region MatchmakingCallbacks
|
||||
|
||||
public void OnCreatedRoom()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnCreateRoomFailed(short returnCode, string message)
|
||||
{
|
||||
Debug.LogErrorFormat("OnCreateRoomFailed errorCode={0} errorMessage={1}", returnCode, message);
|
||||
}
|
||||
|
||||
public void OnFriendListUpdate(List<FriendInfo> friendList)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnJoinedRoom()
|
||||
{
|
||||
if (this.voiceConnection.PrimaryRecorder == null)
|
||||
{
|
||||
this.voiceConnection.PrimaryRecorder = this.gameObject.AddComponent<Recorder>();
|
||||
}
|
||||
if (this.autoTransmit)
|
||||
{
|
||||
this.voiceConnection.PrimaryRecorder.TransmitEnabled = this.autoTransmit;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnJoinRandomFailed(short returnCode, string message)
|
||||
{
|
||||
Debug.LogErrorFormat("OnJoinRandomFailed errorCode={0} errorMessage={1}", returnCode, message);
|
||||
}
|
||||
|
||||
public void OnJoinRoomFailed(short returnCode, string message)
|
||||
{
|
||||
Debug.LogErrorFormat("OnJoinRoomFailed roomName={0} errorCode={1} errorMessage={2}", this.RoomName, returnCode, message);
|
||||
}
|
||||
|
||||
public void OnLeftRoom()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ConnectionCallbacks
|
||||
|
||||
public void OnConnected()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnConnectedToMaster()
|
||||
{
|
||||
this.enterRoomParams.RoomOptions.PublishUserId = this.publishUserId;
|
||||
if (this.RandomRoom)
|
||||
{
|
||||
this.enterRoomParams.RoomName = null;
|
||||
this.voiceConnection.Client.OpJoinRandomOrCreateRoom(new OpJoinRandomRoomParams(), this.enterRoomParams);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.enterRoomParams.RoomName = this.RoomName;
|
||||
this.voiceConnection.Client.OpJoinOrCreateRoom(this.enterRoomParams);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnDisconnected(DisconnectCause cause)
|
||||
{
|
||||
if (cause == DisconnectCause.None || cause == DisconnectCause.DisconnectByClientLogic)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Debug.LogErrorFormat("OnDisconnected cause={0}", cause);
|
||||
}
|
||||
|
||||
public void OnRegionListReceived(RegionHandler regionHandler)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnCustomAuthenticationResponse(Dictionary<string, object> data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnCustomAuthenticationFailed(string debugMessage)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 65b99afb3758e9e4689c28a18224eb8f
|
||||
timeCreated: 1540904523
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: dd940d333aeeaa048842e87b9b259188, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5e696093a38c17043b5fffafad200f41
|
||||
folderAsset: yes
|
||||
timeCreated: 1537958675
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,50 @@
|
||||
namespace Photon.Voice.Unity.UtilityScripts.Editor
|
||||
{
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
[CustomEditor(typeof(ConnectAndJoin))]
|
||||
public class ConnectAndJoinEditor : Editor
|
||||
{
|
||||
private ConnectAndJoin connectAndJoin;
|
||||
private SerializedProperty randomRoomSp;
|
||||
private SerializedProperty roomNameSp;
|
||||
private SerializedProperty autoConnectSp;
|
||||
private SerializedProperty autoTransmitSp;
|
||||
private SerializedProperty publishUserIdSp;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
this.connectAndJoin = this.target as ConnectAndJoin;
|
||||
this.randomRoomSp = this.serializedObject.FindProperty("RandomRoom");
|
||||
this.roomNameSp = this.serializedObject.FindProperty("RoomName");
|
||||
this.autoConnectSp = this.serializedObject.FindProperty("autoConnect");
|
||||
this.autoTransmitSp = this.serializedObject.FindProperty("autoTransmit");
|
||||
this.publishUserIdSp = this.serializedObject.FindProperty("publishUserId");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
EditorGUI.BeginChangeCheck();
|
||||
EditorGUILayout.PropertyField(this.autoConnectSp);
|
||||
EditorGUILayout.PropertyField(this.autoTransmitSp);
|
||||
EditorGUILayout.PropertyField(this.randomRoomSp);
|
||||
EditorGUILayout.PropertyField(this.publishUserIdSp);
|
||||
if (!this.randomRoomSp.boolValue)
|
||||
{
|
||||
EditorGUILayout.PropertyField(this.roomNameSp);
|
||||
}
|
||||
if (Application.isPlaying && !this.connectAndJoin.IsConnected)
|
||||
{
|
||||
if (GUILayout.Button("Connect"))
|
||||
{
|
||||
this.connectAndJoin.ConnectNow();
|
||||
}
|
||||
}
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
this.serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 814145524f648a04fa42d1ac5cbfb885
|
||||
timeCreated: 1537888035
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "PhotonVoice.Utilities.Editor",
|
||||
"references": [
|
||||
"PhotonRealtime",
|
||||
"PhotonVoice"
|
||||
],
|
||||
"optionalUnityReferences": [],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a4110ddd96589404bb35c918cc2fe96b
|
||||
timeCreated: 1538045250
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 63d608879f3e21645b6d9e0cc8a1e6ed
|
||||
folderAsset: yes
|
||||
timeCreated: 1561049831
|
||||
licenseType: Store
|
||||
DefaultImporter:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,105 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Photon.Voice.Unity.UtilityScripts
|
||||
{
|
||||
[RequireComponent(typeof(Recorder))]
|
||||
public class MicAmplifier : VoiceComponent
|
||||
{
|
||||
[SerializeField]
|
||||
private float boostValue;
|
||||
|
||||
[SerializeField]
|
||||
private float amplificationFactor = 1f;
|
||||
|
||||
public float AmplificationFactor
|
||||
{
|
||||
get { return this.amplificationFactor; }
|
||||
set
|
||||
{
|
||||
if (this.amplificationFactor.Equals(value))
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.amplificationFactor = value;
|
||||
if (this.floatProcessor != null)
|
||||
{
|
||||
this.floatProcessor.AmplificationFactor = this.amplificationFactor;
|
||||
}
|
||||
if (this.shortProcessor != null)
|
||||
{
|
||||
this.shortProcessor.AmplificationFactor = (short)this.amplificationFactor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public float BoostValue
|
||||
{
|
||||
get { return this.boostValue; }
|
||||
set
|
||||
{
|
||||
if (this.boostValue.Equals(value))
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.boostValue = value;
|
||||
if (this.floatProcessor != null)
|
||||
{
|
||||
this.floatProcessor.BoostValue = this.boostValue;
|
||||
}
|
||||
if (this.shortProcessor != null)
|
||||
{
|
||||
this.shortProcessor.BoostValue = (short)this.boostValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private MicAmplifierFloat floatProcessor;
|
||||
private MicAmplifierShort shortProcessor;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
if (this.floatProcessor != null)
|
||||
{
|
||||
this.floatProcessor.Disabled = false;
|
||||
}
|
||||
if (this.shortProcessor != null)
|
||||
{
|
||||
this.shortProcessor.Disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
if (this.floatProcessor != null)
|
||||
{
|
||||
this.floatProcessor.Disabled = true;
|
||||
}
|
||||
if (this.shortProcessor != null)
|
||||
{
|
||||
this.shortProcessor.Disabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Message sent by Recorder
|
||||
private void PhotonVoiceCreated(PhotonVoiceCreatedParams p)
|
||||
{
|
||||
if (p.Voice is LocalVoiceAudioFloat)
|
||||
{
|
||||
LocalVoiceAudioFloat v = p.Voice as LocalVoiceAudioFloat;
|
||||
this.floatProcessor = new MicAmplifierFloat(this.AmplificationFactor, this.BoostValue);
|
||||
v.AddPostProcessor(this.floatProcessor);
|
||||
}
|
||||
else if (p.Voice is LocalVoiceAudioShort)
|
||||
{
|
||||
LocalVoiceAudioShort v = p.Voice as LocalVoiceAudioShort;
|
||||
this.shortProcessor = new MicAmplifierShort((short)this.AmplificationFactor, (short)this.BoostValue);
|
||||
//this.shortProcessor = new SimpleAmplifierShortProcessor((short)(this.AmplificationFactor* short.MaxValue), (short)(this.boostValue * short.MaxValue));
|
||||
v.AddPostProcessor(this.shortProcessor);
|
||||
}
|
||||
else if (this.Logger.IsErrorEnabled)
|
||||
{
|
||||
this.Logger.LogError("LocalVoice object has unexpected value/type: {0}", p.Voice == null ? "null" : p.Voice.GetType().ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a3986deb98168394684c41606a9495af
|
||||
timeCreated: 1561048437
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: dd940d333aeeaa048842e87b9b259188, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,33 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace Photon.Voice.Unity.UtilityScripts
|
||||
{
|
||||
[CustomEditor(typeof(MicAmplifier))]
|
||||
public class MicAmplifierEditor : Editor
|
||||
{
|
||||
private MicAmplifier simpleAmplifier;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
this.simpleAmplifier = this.target as MicAmplifier;
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
EditorGUI.BeginChangeCheck();
|
||||
this.simpleAmplifier.AmplificationFactor = EditorGUILayout.FloatField(
|
||||
new GUIContent("Amplification Factor", "Amplification Factor (Multiplication)"),
|
||||
this.simpleAmplifier.AmplificationFactor);
|
||||
this.simpleAmplifier.BoostValue = EditorGUILayout.FloatField(
|
||||
new GUIContent("Boost Value", "Boost Value (Addition)"),
|
||||
this.simpleAmplifier.BoostValue);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
this.serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2ca8fce417a134e4eb5444c7a9d071bb
|
||||
timeCreated: 1561049980
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,48 @@
|
||||
namespace Photon.Voice.Unity.UtilityScripts
|
||||
{
|
||||
|
||||
public class MicAmplifierFloat : IProcessor<float>
|
||||
{
|
||||
public float AmplificationFactor { get; set; }
|
||||
public float BoostValue { get; set; }
|
||||
|
||||
public float MaxBefore { get; private set; }
|
||||
public float MaxAfter { get; private set; }
|
||||
//public float MinBefore { get; private set; }
|
||||
//public float MinAfter { get; private set; }
|
||||
//public float AvgBefore { get; private set; }
|
||||
//public float AvgAfter { get; private set; }
|
||||
|
||||
public bool Disabled { get; set; }
|
||||
|
||||
public MicAmplifierFloat(float amplificationFactor, float boostValue)
|
||||
{
|
||||
this.AmplificationFactor = amplificationFactor;
|
||||
this.BoostValue = boostValue;
|
||||
}
|
||||
|
||||
public float[] Process(float[] buf)
|
||||
{
|
||||
if (this.Disabled)
|
||||
{
|
||||
return buf;
|
||||
}
|
||||
for (int i = 0; i < buf.Length; i++)
|
||||
{
|
||||
float before = buf[i];
|
||||
buf[i] *= this.AmplificationFactor;
|
||||
buf[i] += this.BoostValue;
|
||||
if (this.MaxBefore < before)
|
||||
{
|
||||
this.MaxBefore = before;
|
||||
this.MaxAfter = buf[i];
|
||||
}
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 54f7c01cbf9e64e42bde37b5a0bee411
|
||||
timeCreated: 1561049960
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,49 @@
|
||||
namespace Photon.Voice.Unity.UtilityScripts
|
||||
{
|
||||
public class MicAmplifierShort : IProcessor<short>
|
||||
{
|
||||
public short AmplificationFactor { get; set; }
|
||||
public short BoostValue { get; set; }
|
||||
|
||||
public short MaxBefore { get; private set; }
|
||||
public short MaxAfter { get; private set; }
|
||||
//public short MinBefore { get; private set; }
|
||||
//public short MinAfter { get; private set; }
|
||||
//public short AvgBefore { get; private set; }
|
||||
//public short AvgAfter { get; private set; }
|
||||
|
||||
public bool Disabled { get; set; }
|
||||
|
||||
|
||||
public MicAmplifierShort(short amplificationFactor, short boostValue)
|
||||
{
|
||||
this.AmplificationFactor = amplificationFactor;
|
||||
this.BoostValue = boostValue;
|
||||
}
|
||||
|
||||
public short[] Process(short[] buf)
|
||||
{
|
||||
if (this.Disabled)
|
||||
{
|
||||
return buf;
|
||||
}
|
||||
for (int i = 0; i < buf.Length; i++)
|
||||
{
|
||||
short before = buf[i];
|
||||
buf[i] *= this.AmplificationFactor;
|
||||
buf[i] += this.BoostValue;
|
||||
if (this.MaxBefore < before)
|
||||
{
|
||||
this.MaxBefore = before;
|
||||
this.MaxAfter = buf[i];
|
||||
}
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fa8d3b254d2d2e6488f58f4d71ee2363
|
||||
timeCreated: 1561049971
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,148 @@
|
||||
#if UNITY_ANDROID && !UNITY_EDITOR
|
||||
using UnityEngine.Android;
|
||||
#endif
|
||||
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
using System.Collections;
|
||||
using UnityEngine.iOS;
|
||||
#endif
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Photon.Voice.Unity.UtilityScripts
|
||||
{
|
||||
/// <summary>
|
||||
/// Helper to request Microphone permission on Android or iOS.
|
||||
/// </summary>
|
||||
[RequireComponent(typeof(Recorder))]
|
||||
public class MicrophonePermission : VoiceComponent
|
||||
{
|
||||
private Recorder recorder;
|
||||
#if (UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR
|
||||
private bool isRequesting;
|
||||
#endif
|
||||
private bool hasPermission;
|
||||
|
||||
public static event Action<bool> MicrophonePermissionCallback;
|
||||
|
||||
[SerializeField]
|
||||
private bool autoStart = true;
|
||||
|
||||
public bool HasPermission
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.hasPermission;
|
||||
}
|
||||
private set
|
||||
{
|
||||
this.Logger.LogInfo("Microphone Permission Granted: {0}", value);
|
||||
MicrophonePermissionCallback?.Invoke(value);
|
||||
if (this.hasPermission != value)
|
||||
{
|
||||
this.hasPermission = value;
|
||||
if (this.hasPermission)
|
||||
{
|
||||
this.recorder.AutoStart = this.autoStart;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
this.recorder = this.GetComponent<Recorder>();
|
||||
this.recorder.AutoStart = false;
|
||||
this.InitVoice();
|
||||
}
|
||||
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
IEnumerator PermissionCheck()
|
||||
{
|
||||
this.isRequesting = true;
|
||||
this.Logger.LogInfo("iOS Microphone Permission Request");
|
||||
yield return Application.RequestUserAuthorization(UserAuthorization.Microphone);
|
||||
this.isRequesting = false;
|
||||
if (Application.HasUserAuthorization(UserAuthorization.Microphone))
|
||||
{
|
||||
this.HasPermission = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.HasPermission = false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
public void InitVoice()
|
||||
{
|
||||
#if UNITY_ANDROID && !UNITY_EDITOR
|
||||
if (Permission.HasUserAuthorizedPermission(Permission.Microphone))
|
||||
{
|
||||
this.HasPermission = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Logger.LogInfo("Android Microphone Permission Request");
|
||||
#if UNITY_2020_2_OR_NEWER
|
||||
var callbacks = new PermissionCallbacks();
|
||||
callbacks.PermissionDenied += PermissionCallbacks_PermissionDenied;
|
||||
callbacks.PermissionGranted += PermissionCallbacks_PermissionGranted;
|
||||
callbacks.PermissionDeniedAndDontAskAgain += PermissionCallbacks_PermissionDeniedAndDontAskAgain;
|
||||
Permission.RequestUserPermission(Permission.Microphone, callbacks);
|
||||
#else
|
||||
Permission.RequestUserPermission(Permission.Microphone);
|
||||
#endif
|
||||
this.isRequesting = true;
|
||||
}
|
||||
#elif UNITY_IOS && !UNITY_EDITOR
|
||||
this.StartCoroutine(this.PermissionCheck());
|
||||
#else
|
||||
this.HasPermission = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if UNITY_ANDROID && !UNITY_EDITOR
|
||||
#if UNITY_2020_2_OR_NEWER
|
||||
internal void PermissionCallbacks_PermissionDeniedAndDontAskAgain(string permissionName)
|
||||
{
|
||||
this.isRequesting = false;
|
||||
this.HasPermission = false;
|
||||
this.Logger.LogInfo($"{permissionName} PermissionDeniedAndDontAskAgain");
|
||||
}
|
||||
|
||||
internal void PermissionCallbacks_PermissionGranted(string permissionName)
|
||||
{
|
||||
this.isRequesting = false;
|
||||
this.HasPermission = true;
|
||||
this.Logger.LogInfo($"{permissionName} PermissionGranted");
|
||||
}
|
||||
|
||||
internal void PermissionCallbacks_PermissionDenied(string permissionName)
|
||||
{
|
||||
this.isRequesting = false;
|
||||
this.HasPermission = false;
|
||||
this.Logger.LogInfo($"{permissionName} PermissionDenied");
|
||||
}
|
||||
#else
|
||||
private void OnApplicationFocus(bool focus)
|
||||
{
|
||||
if (focus && this.isRequesting)
|
||||
{
|
||||
if (Permission.HasUserAuthorizedPermission(Permission.Microphone))
|
||||
{
|
||||
this.HasPermission = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.HasPermission = false;
|
||||
}
|
||||
this.isRequesting = false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 98fbb947c07407d4db937da17af98cbf
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,130 @@
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="PhotonVoiceLagSimulationGui.cs" company="Exit Games GmbH">
|
||||
// Part of: Photon Voice Utilities for Unity - Copyright (C) 2018 Exit Games GmbH
|
||||
// </copyright>
|
||||
// <summary>
|
||||
// This MonoBehaviour is a basic GUI for the Photon Voice client's network-simulation feature.
|
||||
// It can modify lag (fixed delay), jitter (random lag), packet loss and audio frames percentage loss.
|
||||
// </summary>
|
||||
// <author>developer@exitgames.com</author>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
using UnityEngine;
|
||||
using ExitGames.Client.Photon;
|
||||
|
||||
namespace Photon.Voice.Unity.UtilityScripts
|
||||
{
|
||||
[RequireComponent(typeof(VoiceConnection))]
|
||||
public class PhotonVoiceLagSimulationGui : MonoBehaviour
|
||||
{
|
||||
private VoiceConnection voiceConnection;
|
||||
|
||||
/// <summary>Positioning rect for window.</summary>
|
||||
private Rect windowRect = new Rect(0, 100, 200, 100);
|
||||
|
||||
/// <summary>Unity GUI Window ID (must be unique or will cause issues).</summary>
|
||||
private int windowId = 201;
|
||||
|
||||
/// <summary>Shows or hides GUI (does not affect settings).</summary>
|
||||
private bool visible = true;
|
||||
|
||||
/// <summary>The peer currently in use (to set the network simulation).</summary>
|
||||
private PhotonPeer peer;
|
||||
|
||||
private float debugLostPercent;
|
||||
|
||||
public void OnEnable()
|
||||
{
|
||||
VoiceConnection[] voiceConnections = this.GetComponents<VoiceConnection>();
|
||||
if (voiceConnections == null || voiceConnections.Length == 0)
|
||||
{
|
||||
Debug.LogError("No VoiceConnection component found, PhotonVoiceStatsGui disabled", this);
|
||||
this.enabled = false;
|
||||
return;
|
||||
}
|
||||
if (voiceConnections.Length > 1)
|
||||
{
|
||||
Debug.LogWarningFormat(this, "Multiple VoiceConnection components found, using first occurrence attached to GameObject {0}", voiceConnections[0].name);
|
||||
}
|
||||
this.voiceConnection = voiceConnections[0];
|
||||
this.peer = this.voiceConnection.Client.LoadBalancingPeer;
|
||||
this.debugLostPercent = this.voiceConnection.VoiceClient.DebugLostPercent;
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
if (!this.visible)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.peer == null)
|
||||
{
|
||||
this.windowRect = GUILayout.Window(this.windowId, this.windowRect, this.NetSimHasNoPeerWindow,
|
||||
"Voice Network Simulation");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.windowRect = GUILayout.Window(this.windowId, this.windowRect, this.NetSimWindow, "Voice Network Simulation");
|
||||
}
|
||||
}
|
||||
|
||||
private void NetSimHasNoPeerWindow(int windowId)
|
||||
{
|
||||
GUILayout.Label("No voice peer to communicate with. ");
|
||||
}
|
||||
|
||||
private void NetSimWindow(int windowId)
|
||||
{
|
||||
GUILayout.Label(string.Format("Rtt:{0,4} +/-{1,3}", this.peer.RoundTripTime,
|
||||
this.peer.RoundTripTimeVariance));
|
||||
|
||||
bool simEnabled = this.peer.IsSimulationEnabled;
|
||||
bool newSimEnabled = GUILayout.Toggle(simEnabled, "Simulate");
|
||||
if (newSimEnabled != simEnabled)
|
||||
{
|
||||
this.peer.IsSimulationEnabled = newSimEnabled;
|
||||
}
|
||||
|
||||
float inOutLag = this.peer.NetworkSimulationSettings.IncomingLag;
|
||||
GUILayout.Label(string.Format("Lag {0}", inOutLag));
|
||||
inOutLag = GUILayout.HorizontalSlider(inOutLag, 0, 500);
|
||||
|
||||
this.peer.NetworkSimulationSettings.IncomingLag = (int)inOutLag;
|
||||
this.peer.NetworkSimulationSettings.OutgoingLag = (int)inOutLag;
|
||||
|
||||
float inOutJitter = this.peer.NetworkSimulationSettings.IncomingJitter;
|
||||
GUILayout.Label(string.Format("Jit {0}", inOutJitter));
|
||||
inOutJitter = GUILayout.HorizontalSlider(inOutJitter, 0, 100);
|
||||
|
||||
this.peer.NetworkSimulationSettings.IncomingJitter = (int)inOutJitter;
|
||||
this.peer.NetworkSimulationSettings.OutgoingJitter = (int)inOutJitter;
|
||||
|
||||
float loss = this.peer.NetworkSimulationSettings.IncomingLossPercentage;
|
||||
GUILayout.Label(string.Format("Loss {0}", loss));
|
||||
loss = GUILayout.HorizontalSlider(loss, 0, 10);
|
||||
|
||||
this.peer.NetworkSimulationSettings.IncomingLossPercentage = (int)loss;
|
||||
this.peer.NetworkSimulationSettings.OutgoingLossPercentage = (int)loss;
|
||||
|
||||
GUILayout.Label(string.Format("Lost Audio Frames {0}%", (int)this.debugLostPercent));
|
||||
this.debugLostPercent = GUILayout.HorizontalSlider(this.debugLostPercent, 0, 100);
|
||||
if (newSimEnabled)
|
||||
{
|
||||
this.voiceConnection.VoiceClient.DebugLostPercent = (int)this.debugLostPercent;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.voiceConnection.VoiceClient.DebugLostPercent = 0;
|
||||
}
|
||||
|
||||
// if anything was clicked, the height of this window is likely changed. reduce it to be layouted again next frame
|
||||
if (GUI.changed)
|
||||
{
|
||||
this.windowRect.height = 100;
|
||||
}
|
||||
|
||||
GUI.DragWindow();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 28c5a759338295941af2080959c92312
|
||||
timeCreated: 1539349756
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: dd940d333aeeaa048842e87b9b259188, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,206 @@
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="PhotonVoiceStatsGui.cs" company="Exit Games GmbH">
|
||||
// Part of: Photon Voice Utilities for Unity - Copyright (C) 2018 Exit Games GmbH
|
||||
// </copyright>
|
||||
// <summary>
|
||||
// This MonoBehaviour is a basic GUI for the Photon Voice client's network statistics.
|
||||
// </summary>
|
||||
// <author>developer@exitgames.com</author>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
using ExitGames.Client.Photon;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Photon.Voice.Unity.UtilityScripts
|
||||
{
|
||||
/// <summary>
|
||||
/// Basic GUI to show traffic and health statistics of the connection to Photon,
|
||||
/// toggled by shift+tab.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The shown health values can help identify problems with connection losses or performance.
|
||||
/// Example:
|
||||
/// If the time delta between two consecutive SendOutgoingCommands calls is a second or more,
|
||||
/// chances rise for a disconnect being caused by this (because acknowledgments to the server
|
||||
/// need to be sent in due time).
|
||||
/// </remarks>
|
||||
public class PhotonVoiceStatsGui : MonoBehaviour
|
||||
{
|
||||
/// <summary>Shows or hides GUI (does not affect if stats are collected).</summary>
|
||||
private bool statsWindowOn = true;
|
||||
|
||||
/// <summary>Option to turn collecting stats on or off (used in Update()).</summary>
|
||||
private bool statsOn;
|
||||
|
||||
/// <summary>Shows additional "health" values of connection.</summary>
|
||||
private bool healthStatsVisible;
|
||||
|
||||
/// <summary>Shows additional "lower level" traffic stats.</summary>
|
||||
private bool trafficStatsOn;
|
||||
|
||||
/// <summary>Show buttons to control stats and reset them.</summary>
|
||||
private bool buttonsOn;
|
||||
|
||||
private bool voiceStatsOn = true;
|
||||
|
||||
/// <summary>Positioning rect for window.</summary>
|
||||
private Rect statsRect = new Rect(0, 100, 300, 50);
|
||||
|
||||
/// <summary>Unity GUI Window ID (must be unique or will cause issues).</summary>
|
||||
private int windowId = 200;
|
||||
|
||||
/// <summary>The peer currently in use (to set the network simulation).</summary>
|
||||
private PhotonPeer peer;
|
||||
|
||||
private VoiceConnection voiceConnection;
|
||||
|
||||
private VoiceClient voiceClient;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
VoiceConnection[] voiceConnections = this.GetComponents<VoiceConnection>();
|
||||
if (voiceConnections == null || voiceConnections.Length == 0)
|
||||
{
|
||||
Debug.LogError("No VoiceConnection component found, PhotonVoiceStatsGui disabled", this);
|
||||
this.enabled = false;
|
||||
return;
|
||||
}
|
||||
if (voiceConnections.Length > 1)
|
||||
{
|
||||
Debug.LogWarningFormat(this, "Multiple VoiceConnection components found, using first occurrence attached to GameObject {0}", voiceConnections[0].name);
|
||||
}
|
||||
this.voiceConnection = voiceConnections[0];
|
||||
this.voiceClient = this.voiceConnection.VoiceClient;
|
||||
this.peer = this.voiceConnection.Client.LoadBalancingPeer;
|
||||
if (this.statsRect.x <= 0)
|
||||
{
|
||||
this.statsRect.x = Screen.width - this.statsRect.width;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Checks for shift+tab input combination (to toggle statsOn).</summary>
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Tab) && Input.GetKey(KeyCode.LeftShift))
|
||||
{
|
||||
this.statsWindowOn = !this.statsWindowOn;
|
||||
this.statsOn = true; // enable stats when showing the window
|
||||
}
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
if (this.peer.TrafficStatsEnabled != this.statsOn)
|
||||
{
|
||||
this.peer.TrafficStatsEnabled = this.statsOn;
|
||||
}
|
||||
|
||||
if (!this.statsWindowOn)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.statsRect = GUILayout.Window(this.windowId, this.statsRect, this.TrafficStatsWindow, "Voice Client Messages (shift+tab)");
|
||||
}
|
||||
|
||||
private void TrafficStatsWindow(int windowId)
|
||||
{
|
||||
bool statsToLog = false;
|
||||
TrafficStatsGameLevel gls = this.peer.TrafficStatsGameLevel;
|
||||
long elapsedMs = this.peer.TrafficStatsElapsedMs / 1000;
|
||||
if (elapsedMs == 0)
|
||||
{
|
||||
elapsedMs = 1;
|
||||
}
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
this.buttonsOn = GUILayout.Toggle(this.buttonsOn, "buttons");
|
||||
this.healthStatsVisible = GUILayout.Toggle(this.healthStatsVisible, "health");
|
||||
this.trafficStatsOn = GUILayout.Toggle(this.trafficStatsOn, "traffic");
|
||||
this.voiceStatsOn = GUILayout.Toggle(this.voiceStatsOn, "voice stats");
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
string total = string.Format("Out {0,4} | In {1,4} | Sum {2,4}", gls.TotalOutgoingMessageCount, gls.TotalIncomingMessageCount, gls.TotalMessageCount);
|
||||
string elapsedTime = string.Format("{0}sec average:", elapsedMs);
|
||||
string average = string.Format("Out {0,4} | In {1,4} | Sum {2,4}", gls.TotalOutgoingMessageCount / elapsedMs, gls.TotalIncomingMessageCount / elapsedMs, gls.TotalMessageCount / elapsedMs);
|
||||
GUILayout.Label(total);
|
||||
GUILayout.Label(elapsedTime);
|
||||
GUILayout.Label(average);
|
||||
|
||||
if (this.buttonsOn)
|
||||
{
|
||||
GUILayout.BeginHorizontal();
|
||||
this.statsOn = GUILayout.Toggle(this.statsOn, "stats on");
|
||||
if (GUILayout.Button("Reset"))
|
||||
{
|
||||
this.peer.TrafficStatsReset();
|
||||
this.peer.TrafficStatsEnabled = true;
|
||||
}
|
||||
statsToLog = GUILayout.Button("To Log");
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
string trafficStatsIn = string.Empty;
|
||||
string trafficStatsOut = string.Empty;
|
||||
if (this.trafficStatsOn)
|
||||
{
|
||||
GUILayout.Box("Voice Client Traffic Stats");
|
||||
trafficStatsIn = string.Concat("Incoming: \n", this.peer.TrafficStatsIncoming);
|
||||
trafficStatsOut = string.Concat("Outgoing: \n", this.peer.TrafficStatsOutgoing);
|
||||
GUILayout.Label(trafficStatsIn);
|
||||
GUILayout.Label(trafficStatsOut);
|
||||
}
|
||||
|
||||
string healthStats = string.Empty;
|
||||
if (this.healthStatsVisible)
|
||||
{
|
||||
GUILayout.Box("Voice Client Health Stats");
|
||||
healthStats = string.Format(
|
||||
"ping: {6}|{9}[+/-{7}|{10}]ms resent:{8} \n\nmax ms between\nsend: {0,4} \ndispatch: {1,4} \n\nlongest dispatch for: \nev({3}):{2,3}ms \nop({5}):{4,3}ms",
|
||||
gls.LongestDeltaBetweenSending,
|
||||
gls.LongestDeltaBetweenDispatching,
|
||||
gls.LongestEventCallback,
|
||||
gls.LongestEventCallbackCode,
|
||||
gls.LongestOpResponseCallback,
|
||||
gls.LongestOpResponseCallbackOpCode,
|
||||
this.peer.RoundTripTime,
|
||||
this.peer.RoundTripTimeVariance,
|
||||
this.peer.ResentReliableCommands,
|
||||
this.voiceClient.RoundTripTime,
|
||||
this.voiceClient.RoundTripTimeVariance);
|
||||
GUILayout.Label(healthStats);
|
||||
}
|
||||
|
||||
string voiceStats = string.Empty;
|
||||
if (this.voiceStatsOn)
|
||||
{
|
||||
GUILayout.Box("Voice Frames Stats");
|
||||
voiceStats = string.Format("received: {0}, {1:F2}/s \n\nlost: {2}, {3:F2}/s ({4:F2}%) \n\nsent: {5} ({6} bytes)",
|
||||
this.voiceClient.FramesReceived,
|
||||
this.voiceConnection.FramesReceivedPerSecond,
|
||||
this.voiceClient.FramesLost,
|
||||
this.voiceConnection.FramesLostPerSecond,
|
||||
this.voiceConnection.FramesLostPercent,
|
||||
this.voiceClient.FramesSent,
|
||||
this.voiceClient.FramesSentBytes);
|
||||
GUILayout.Label(voiceStats);
|
||||
}
|
||||
|
||||
if (statsToLog)
|
||||
{
|
||||
string complete = string.Format("{0}\n{1}\n{2}\n{3}\n{4}\n{5}", total, elapsedTime, average, trafficStatsIn, trafficStatsOut, healthStats);
|
||||
Debug.Log(complete);
|
||||
}
|
||||
|
||||
// if anything was clicked, the height of this window is likely changed. reduce it to be layouted again next frame
|
||||
if (GUI.changed)
|
||||
{
|
||||
this.statsRect.height = 100;
|
||||
}
|
||||
|
||||
GUI.DragWindow();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d7b4b6b64f1b474d802f50cb9c720a2
|
||||
timeCreated: 1549624795
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: dd940d333aeeaa048842e87b9b259188, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,70 @@
|
||||
namespace Photon.Voice.Unity.UtilityScripts
|
||||
{
|
||||
using UnityEngine;
|
||||
using System.IO;
|
||||
using CSCore;
|
||||
using CSCore.Codecs.WAV;
|
||||
|
||||
[RequireComponent(typeof(VoiceConnection))]
|
||||
[DisallowMultipleComponent]
|
||||
public class SaveIncomingStreamToFile : VoiceComponent
|
||||
{
|
||||
private VoiceConnection voiceConnection;
|
||||
|
||||
[SerializeField]
|
||||
private bool muteLocalSpeaker = false;
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
this.voiceConnection = this.GetComponent<VoiceConnection>();
|
||||
this.voiceConnection.RemoteVoiceAdded += this.OnRemoteVoiceAdded;
|
||||
this.voiceConnection.SpeakerLinked += this.OnSpeakerLinked;
|
||||
}
|
||||
|
||||
private void OnSpeakerLinked(Speaker speaker)
|
||||
{
|
||||
if (this.muteLocalSpeaker && speaker.Actor != null && speaker.Actor.IsLocal)
|
||||
{
|
||||
AudioSource audioSource = speaker.GetComponent<AudioSource>();
|
||||
audioSource.mute = true;
|
||||
audioSource.volume = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
this.voiceConnection.SpeakerLinked -= this.OnSpeakerLinked;
|
||||
this.voiceConnection.RemoteVoiceAdded -= this.OnRemoteVoiceAdded;
|
||||
}
|
||||
|
||||
private void OnRemoteVoiceAdded(RemoteVoiceLink remoteVoiceLink)
|
||||
{
|
||||
int bitsPerSample = 32;
|
||||
string filePath = this.GetFilePath(remoteVoiceLink);
|
||||
if (this.Logger.IsInfoEnabled)
|
||||
{
|
||||
this.Logger.LogInfo("Incoming stream, output file path: {0}", filePath);
|
||||
}
|
||||
WaveWriter waveWriter = new WaveWriter(filePath, new WaveFormat(remoteVoiceLink.Info.SamplingRate, bitsPerSample, remoteVoiceLink.Info.Channels));
|
||||
remoteVoiceLink.FloatFrameDecoded += f => { waveWriter.WriteSamples(f.Buf, 0, f.Buf.Length); };
|
||||
remoteVoiceLink.RemoteVoiceRemoved += () =>
|
||||
{
|
||||
if (this.Logger.IsInfoEnabled)
|
||||
{
|
||||
this.Logger.LogInfo("Remote voice stream removed: Saving wav file.");
|
||||
}
|
||||
waveWriter.Dispose();
|
||||
};
|
||||
}
|
||||
|
||||
private string GetFilePath(RemoteVoiceLink remoteVoiceLink)
|
||||
{
|
||||
string filename = string.Format("in_{0}_{1}_{2}_{3}_{4}.wav",
|
||||
System.DateTime.UtcNow.ToString("yyyy-MM-dd_HH-mm-ss-ffff"), Random.Range(0, 1000),
|
||||
remoteVoiceLink.ChannelId, remoteVoiceLink.PlayerId, remoteVoiceLink.VoiceId);
|
||||
return Path.Combine(Application.persistentDataPath, filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5e15851e17423014d9155ec2de326e2e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,106 @@
|
||||
namespace Photon.Voice.Unity.UtilityScripts
|
||||
{
|
||||
using UnityEngine;
|
||||
using System.IO;
|
||||
using CSCore;
|
||||
using CSCore.Codecs.WAV;
|
||||
|
||||
[RequireComponent(typeof(Recorder))]
|
||||
[DisallowMultipleComponent]
|
||||
public class SaveOutgoingStreamToFile : VoiceComponent
|
||||
{
|
||||
private WaveWriter wavWriter;
|
||||
|
||||
private void PhotonVoiceCreated(PhotonVoiceCreatedParams photonVoiceCreatedParams)
|
||||
{
|
||||
VoiceInfo voiceInfo = photonVoiceCreatedParams.Voice.Info;
|
||||
int bitsPerSample = 32;
|
||||
if (photonVoiceCreatedParams.Voice is LocalVoiceAudioShort)
|
||||
{
|
||||
bitsPerSample = 16;
|
||||
}
|
||||
string filePath = this.GetFilePath();
|
||||
this.wavWriter = new WaveWriter(filePath, new WaveFormat(voiceInfo.SamplingRate, bitsPerSample, voiceInfo.Channels));
|
||||
if (this.Logger.IsInfoEnabled)
|
||||
{
|
||||
this.Logger.LogInfo("Outgoing stream, output file path: {0}", filePath);
|
||||
}
|
||||
if (photonVoiceCreatedParams.Voice is LocalVoiceAudioFloat)
|
||||
{
|
||||
LocalVoiceAudioFloat localVoiceAudioFloat = photonVoiceCreatedParams.Voice as LocalVoiceAudioFloat;
|
||||
localVoiceAudioFloat.AddPreProcessor(new OutgoingStreamSaverFloat(this.wavWriter));
|
||||
}
|
||||
else if (photonVoiceCreatedParams.Voice is LocalVoiceAudioShort)
|
||||
{
|
||||
LocalVoiceAudioShort localVoiceAudioShort = photonVoiceCreatedParams.Voice as LocalVoiceAudioShort;
|
||||
localVoiceAudioShort.AddPreProcessor(new OutgoingStreamSaverShort(this.wavWriter));
|
||||
}
|
||||
}
|
||||
|
||||
private string GetFilePath()
|
||||
{
|
||||
string filename = string.Format("out_{0}_{1}.wav", System.DateTime.UtcNow.ToString("yyyy-MM-dd_HH-mm-ss-ffff"), Random.Range(0, 1000));
|
||||
return Path.Combine(Application.persistentDataPath, filename);
|
||||
}
|
||||
|
||||
private void PhotonVoiceRemoved()
|
||||
{
|
||||
this.wavWriter.Dispose();
|
||||
if (this.Logger.IsInfoEnabled)
|
||||
{
|
||||
this.Logger.LogInfo("Recording stopped: Saving wav file.");
|
||||
}
|
||||
}
|
||||
|
||||
class OutgoingStreamSaverFloat : IProcessor<float>
|
||||
{
|
||||
private WaveWriter wavWriter;
|
||||
|
||||
public OutgoingStreamSaverFloat(WaveWriter waveWriter)
|
||||
{
|
||||
this.wavWriter = waveWriter;
|
||||
}
|
||||
|
||||
public float[] Process(float[] buf)
|
||||
{
|
||||
this.wavWriter.WriteSamples(buf, 0, buf.Length);
|
||||
return buf;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (!this.wavWriter.IsDisposed && !this.wavWriter.IsDisposing)
|
||||
{
|
||||
this.wavWriter.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class OutgoingStreamSaverShort : IProcessor<short>
|
||||
{
|
||||
private WaveWriter wavWriter;
|
||||
|
||||
public OutgoingStreamSaverShort(WaveWriter waveWriter)
|
||||
{
|
||||
this.wavWriter = waveWriter;
|
||||
}
|
||||
|
||||
public short[] Process(short[] buf)
|
||||
{
|
||||
for (int i = 0; i < buf.Length; i++)
|
||||
{
|
||||
this.wavWriter.Write(buf[i]);
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (!this.wavWriter.IsDisposed && !this.wavWriter.IsDisposing)
|
||||
{
|
||||
this.wavWriter.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cfeca74c1df0b9049851206739235387
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
87
Assets/Photon/PhotonVoice/Code/UtilityScripts/TestTone.cs
Normal file
87
Assets/Photon/PhotonVoice/Code/UtilityScripts/TestTone.cs
Normal file
@@ -0,0 +1,87 @@
|
||||
// --------------------------------------------------------------------------------
|
||||
// <copyright file="TestTone.cs" company="Exit Games GmbH">
|
||||
// Part of: Photon Voice Utilities for Unity - Copyright (C) 2018 Exit Games GmbH
|
||||
// </copyright>
|
||||
// <summary>
|
||||
// This MonoBehaviour is a sample demo of how to use AudioSource.Factory
|
||||
// by implementing IAudioReader.
|
||||
// </summary>
|
||||
// <author>developer@exitgames.com</author>
|
||||
// --------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Photon.Voice.Unity.UtilityScripts
|
||||
{
|
||||
[RequireComponent(typeof(Recorder))]
|
||||
public class TestTone : MonoBehaviour
|
||||
{
|
||||
private void Start()
|
||||
{
|
||||
Recorder rec = this.gameObject.GetComponent<Recorder>();
|
||||
rec.SourceType = Recorder.InputSourceType.Factory;
|
||||
rec.InputFactory = () =>
|
||||
{
|
||||
return new ToneAudioReader();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// IAudioReader implementation sample. Provides constant tone signal.
|
||||
// See also MicWrapper and AudioClipWrapper
|
||||
// Because of current resamplig algorithm, the tone is distorted if SamplingRate not equals encoder sampling rate.
|
||||
class ToneAudioReader : IAudioReader<float>
|
||||
{
|
||||
private double k;
|
||||
private long timeSamples;
|
||||
|
||||
public ToneAudioReader()
|
||||
{
|
||||
this.k = 2 * Math.PI * 440 / this.SamplingRate;
|
||||
}
|
||||
public int Channels { get { return 2; } }
|
||||
|
||||
public int SamplingRate { get { return 24000; } }
|
||||
|
||||
public string Error
|
||||
{
|
||||
get
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
|
||||
public bool Read(float[] buf)
|
||||
{
|
||||
var bufSamples = buf.Length / this.Channels;
|
||||
var t = (long)(AudioSettings.dspTime * this.SamplingRate);
|
||||
|
||||
var deltaTimeSamples = t - this.timeSamples;
|
||||
if (Math.Abs(deltaTimeSamples) > this.SamplingRate / 4) // when started or Read has not been called for a while
|
||||
{
|
||||
Debug.LogWarningFormat("ToneAudioReader sample time is out: {0} / {1}", this.timeSamples, t);
|
||||
deltaTimeSamples = bufSamples;
|
||||
this.timeSamples = t - bufSamples;
|
||||
}
|
||||
|
||||
if (deltaTimeSamples < bufSamples)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
int x = 0;
|
||||
for (int i = 0; i < bufSamples; i++)
|
||||
{
|
||||
var v = (float)Math.Sin(this.timeSamples++ * this.k) * 0.2f;
|
||||
for (int j = 0; j < this.Channels; j++)
|
||||
buf[x++] = v;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 164ef2a94699d485abc9c2530d65736f
|
||||
timeCreated: 1540904558
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: dd940d333aeeaa048842e87b9b259188, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user