Sound class represents a sound resource containing audio data and metadata.
Properties
Gets the audio file type (AAC, WAV, or MP3).
Gets the samples per second.
Gets the bit size.
Gets the number of channels. 1 for mono, 2 for stereo.
Gets the bitstream encoding format.
Gets the size of each audio sample in bytes.
Gets the total number of audio samples.
Gets the loop start position in samples.
Gets the loop end position in samples.
Gets the duration of the sound in seconds.
Gets the sentence data containing phoneme and emphasis information.
Gets the WAVE format header data for ADPCM audio.
Gets the size of the streaming audio data in bytes.
Methods
GetSound
Returns a fully playable sound data. In case of WAV files, header is automatically generated as Valve removes it when compiling.Byte array containing sound data.
GetSoundStream
Returns a fully playable sound data as a stream. In case of WAV files, header is automatically generated as Valve removes it when compiling.Memory stream containing sound data.
ConstructFromCtrl
Constructs sound data from the control block.True if successfully constructed from control block.
Enumerations
AudioFileType
Specifies the audio file container type.AAC- AAC containerWAV- WAVE containerMP3- MP3 container
AudioFormatV4
Specifies the audio encoding format for version 4 sound files.PCM16- 16-bit PCMPCM8- 8-bit PCMMP3- MP3 encodingADPCM- ADPCM encoding
WaveAudioFormat
Specifies the WAVE audio encoding format.Unknown- Unknown formatPCM- PCM formatADPCM- ADPCM format
Structures
Sentence
Represents a sentence with phoneme and emphasis data for voice playback.Gets the phoneme tags for lip-sync.
PhonemeTag
Represents a phoneme timing tag for lip-sync animation.Gets the start time of the phoneme.
Gets the end time of the phoneme.
Gets the phoneme identifier code.