Files
Webcam/include/framework/audio/sample_format.h
2026-06-22 11:49:35 +02:00

47 lines
1.0 KiB
C++

/* -----------------------------------------------------------------------------
GSFramework
Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
----------------------------------------------------------------------------- */
#ifndef __NSAMPLEFORMAT__
#define __NSAMPLEFORMAT__
#include "ntypes.h"
namespace GS {
/*!
@short Sample format.
@author Emmanuel Julien (ejulien@nworks.fr)
*/
struct SampleFormat
{
enum Format
{
Format_PCM = 0,
#if __PLATFORM_NINTENDO_WII__
Format_Wii_ADPCM
#endif
};
Format format;
uint channels;
uint frequency;
uchar resolution;
/// Get the PCM data memory footprint a given number of samples in this format.
uint GetPCMDataSize(uint sample_count) const
{ return (sample_count * channels * resolution) / 8; }
SampleFormat(Format _format = Format_PCM, uint _channels = 2, uint _frequency = 48000, uchar _bit_per_sample = 16) : format(_format), channels(_channels), frequency(_frequency), resolution(_bit_per_sample) {}
};
} // GS
#endif // __NSAMPLEFORMAT__