RioEngine  0.1
My first attempt to create a 3D WYSIWYG Game Engine
ik_SAudioStreamFormat.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2014 Nikolaus Gebhardt
2 // This file is part of the "irrKlang" library.
3 // For conditions of distribution and use, see copyright notice in irrKlang.h
4 
5 #ifndef __S_IRRKLANG_AUDIO_STREAM_FORMAT_H_INCLUDED__
6 #define __S_IRRKLANG_AUDIO_STREAM_FORMAT_H_INCLUDED__
7 
8 #include "ik_IRefCounted.h"
9 
10 
11 namespace irrklang
12 {
13 
16  {
19 
22  };
23 
24 
27  {
30 
32 
34 
37 
40 
42  inline ik_s32 getSampleSize() const
43  {
44  return (SampleFormat == ESF_U8) ? 1 : 2;
45  }
46 
48  inline ik_s32 getFrameSize() const
49  {
50  return ChannelCount * getSampleSize();
51  }
52 
54  /* Returns an invalid negative value when the stream has an unknown lenght */
55  inline ik_s32 getSampleDataSize() const
56  {
57  return getFrameSize() * FrameCount;
58  }
59 
61  inline ik_s32 getBytesPerSecond() const
62  {
63  return getFrameSize() * SampleRate;
64  }
65  };
66 
67 
68 } // end namespace irrklang
69 
70 #endif
71 
structure describing an audio stream format with helper functions
ik_s32 getFrameSize() const
returns the frame size of the stream data in bytes
signed int ik_s32
32 bit signed variable.
Everything in the irrKlang Sound Engine can be found in this namespace.
ik_s32 getSampleSize() const
returns the size of a sample of the data described by the stream data in bytes
one unsigned byte (0;255)
ESampleFormat SampleFormat
format of the sample data
16 bit, signed (-32k;32k)
ESampleFormat
audio sample data format enumeration for supported formats
ik_s32 getSampleDataSize() const
returns the size of the sample data in bytes
ik_s32 ChannelCount
channels, 1 for mono, 2 for stereo
ik_s32 SampleRate
samples per second
ik_s32 getBytesPerSecond() const
returns amount of bytes per second
ik_s32 FrameCount
amount of frames in the sample data or stream.