<commit_before>//
// Types to shared by platforms and config. dialog.
//

#ifndef AUDIODEFS_H
#define AUDIODEFS_H

#include <string>
#include <vector>
#include <queue>

//TODO sufficient for linux too?
struct AudioDeviceInfoA
{
    //int intID; //optional ID
    std::string strID;
    std::string strName; //gui name
};

struct AudioDeviceInfoW
{
    //int intID; //optional ID
    std::wstring strID;
    std::wstring strName; //gui name
};

#if _WIN32
#define AudioDeviceInfo AudioDeviceInfoW
#else
#define AudioDeviceInfo AudioDeviceInfoA
#endif

class AudioSource
{
public:
	virtual ~AudioSource();
	//get buffer, converted to 16bit int format
	virtual uint32_t GetBuffer(int16_t *buff, uint32_t len) = 0;
	/*
		Get how many frames has been recorded so that caller knows 
		how much to allocated for 16-bit buffer.
	*/
	virtual bool GetFrames(uint32_t *size) = 0;
	virtual void SetResampling(int samplerate) = 0;
	virtual uint32_t GetChannels() = 0;

	virtual void Start(){}
	virtual void Stop(){}
};

typedef std::vector<AudioDeviceInfo> AudioDeviceInfoList;

bool AudioInit();
void AudioDeinit();
AudioSource *CreateNewAudioSource(AudioDeviceInfo &dev);<commit_msg>~AudioSource() missing body.<commit_after>//
// Types to shared by platforms and config. dialog.
//

#ifndef AUDIODEFS_H
#define AUDIODEFS_H

#include <string>
#include <vector>
#include <queue>

//TODO sufficient for linux too?
struct AudioDeviceInfoA
{
    //int intID; //optional ID
    std::string strID;
    std::string strName; //gui name
};

struct AudioDeviceInfoW
{
    //int intID; //optional ID
    std::wstring strID;
    std::wstring strName; //gui name
};

#if _WIN32
#define AudioDeviceInfo AudioDeviceInfoW
#else
#define AudioDeviceInfo AudioDeviceInfoA
#endif

class AudioSource
{
public:
	virtual ~AudioSource() {}
	//get buffer, converted to 16bit int format
	virtual uint32_t GetBuffer(int16_t *buff, uint32_t len) = 0;
	/*
		Get how many frames has been recorded so that caller knows 
		how much to allocated for 16-bit buffer.
	*/
	virtual bool GetFrames(uint32_t *size) = 0;
	virtual void SetResampling(int samplerate) = 0;
	virtual uint32_t GetChannels() = 0;

	virtual void Start(){}
	virtual void Stop(){}
};

typedef std::vector<AudioDeviceInfo> AudioDeviceInfoList;

bool AudioInit();
void AudioDeinit();
AudioSource *CreateNewAudioSource(AudioDeviceInfo &dev);
{'fraction_non_alphanumeric': 0.10546378653113088, 'fraction_numerical': 0.0169419737399407, 'mean_word_length': 4.454965357967668, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5258013', 'n_tokens_mistral': 807, 'n_tokens_neox': 766, 'n_words': 251}