Codec.cpp 607 Bytes
Newer Older
jcacerec's avatar
jcacerec committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "Codec.h"
#include "AudioInterface.h"

Codec::Codec() {}

void Codec::setup(AudioInterface* audioInterface)
{
    this->audioInterface = audioInterface;
    totalSizeBytes = audioInterface->getSizeInBytesPerChannel() * audioInterface->getNumInputChannels();
}

void Codec::stop() {}

void Codec::encode(int8_t* original, int8_t* compressed)
{
    std::memcpy(compressed, original, totalSizeBytes);
}

void Codec::decode(int8_t* compressed, int8_t* uncompressed)
{
    std::memcpy(uncompressed, compressed, totalSizeBytes);
}

size_t Codec::getTotalCodecSizeInBytes()
{
    return totalSizeBytes;
}