non-vr lobby, version fix

This commit is contained in:
joonasp
2022-06-29 14:45:17 +03:00
parent 5774be9822
commit 04baadfad1
1774 changed files with 573069 additions and 1533 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e70c6b0e644598b458dbb42ace191228
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 14a588271ffedcb44968c878818b7871
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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");
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 03a5e54186895d548a426573dcd38b22
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d6a03d1238626a94cbad8f83782f22eb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4903a9a437074914ebd63a1298f684e7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3cd34287d9d0abb43816d791896fe275
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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; }
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b50967e9192a7cf4284b0ffad20718f2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 783f914c3776f4041b78c8639efe832f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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);*/
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4bcb558a4ff125b4e8078864d6b39531
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 49b581aba0acb904897782786821c602
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5d3c9bf63affc0f4fb0921bad33ffb91
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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();
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: bd1311d5300bf934aa43ba92b819427b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8f3be84641ff7b543b200b146b3e8d37
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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.

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 31539401d6075c44daf952351a39dafd
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: