AUI Framework  master
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
ASampleFormat.h
    1#pragma once
    2
    3#include <type_traits>
    4#include <cstdint>
    5#include <cstddef>
    6#include "AUI/Common/AException.h"
    7
   16    I16,
   17
   21    I24,
   22
   26    I32
   27};
   28
   29namespace aui::audio {
   30    constexpr size_t bytesPerSample(ASampleFormat format) {
   31        switch (format) {
   32            case ASampleFormat::I16:
   33                return 2;
   34
   35            case ASampleFormat::I24:
   36                return 3;
   37
   38            case ASampleFormat::I32:
   39                return 4;
   40        }
   41
   42        throw AException("Wrong sample format");
   43    }
   44}
ASampleFormat
Sample formats supported for mixing.
Definition ASampleFormat.h:12
@ I16
Signed 16-bit integer.
Definition ASampleFormat.h:16
@ I24
Signed 24-bit integer.
Definition ASampleFormat.h:21
@ I32
Signed 32-bit integer.
Definition ASampleFormat.h:26