Newer
Older
Import / applications / HighwayDash / ports / Platform / iOS / AudioRenderer.h
@John Ryland John Ryland on 22 Dec 2020 850 bytes import NUC files
//
//  AudioRenderer.h
//  HighwayDash
//
//  Created by John Ryland on 18/02/2016.
//  Copyright © 2016 John Ryland. All rights reserved.
//

#ifndef AUDIO_RENDERER_H
#define AUDIO_RENDERER_H


#include <memory>


enum SampleRate
{
    SampleRate_8000Hz  = 8000,
    SampleRate_22050Hz = 22050,
    SampleRate_44100Hz = 44100,
};

enum BitsPerChannel
{
    Bits_8   = 8,
    Bits_16  = 16
};

enum Channels
{
    Mono     = 1,
    Stereo   = 2
};


class AudioRenderer
{
public:
    AudioRenderer();
    virtual ~AudioRenderer();
    
    void initialize(SampleRate a_rate, BitsPerChannel a_bitsPerChannel, Channels a_channels);
    void start();
    void stop();
    
    virtual void renderSamples(void* a_outputBuffer, size_t a_frameCount) = 0;
    
private:
    struct Pimpl;
    std::unique_ptr<Pimpl> m_pimpl;
};


#endif // AUDIO_RENDERER_H