#pragma once

#include <vector>
#include <string>

namespace secondvoice {

class AudioBuffer {
public:
    AudioBuffer(int sample_rate, int channels);

    void addSamples(const std::vector<float>& samples);
    std::vector<float> getSamples() const;
    void clear();

    bool saveToWav(const std::string& filename) const;
    bool saveToOpus(const std::string& filename) const;

    size_t size() const { return samples_.size(); }
    bool empty() const { return samples_.empty(); }

private:
    int sample_rate_;
    int channels_;
    std::vector<float> samples_;
};

} // namespace secondvoice
