In the past, voice chat was performed in frozen battles. At that time, voicechat was transplanted for the progress. However, in terms of code quality, voicechat is not well designed, especially as a general chat framework, and is not easy to use. Now we have no time to rewrite a new voice chat library.
On the interface, devices is provided to traverse devices.
class devices{public:static std::vector<const PaDeviceInfo*> getInputDevices();static std::vector<const PaDeviceInfo*> getOutputDevices();};
Sound is provided for audio setting.
class sound{public: sound(); ~sound(); void start(); void stop(); void th_func(); boost::signals2::signal<void(char *, int)> sigCapture; bool setOutputDevice(PaDeviceIndex index); bool setInputDevice(PaDeviceIndex index); void setsoundsize(); void setechostate(bool on);private: static int inputcallback(const void *input, void *output, unsigned long frameCount, const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags, void *userData); static int outputcallback(const void *input, void *output, unsigned long frameCount, const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags, void *userData);private: };
Provides a client for managing multi-user chats.
client * create_client(int index = 0);client * get_client(int index);typedef void(*handle_iterator_client)(std::map<int, client*> & set);void iterator_client_set(handle_iterator_client fn);void iterator_client_set(std::function<void(std::map<int, client*> &) > fn);bool destroy_client(int index);int client_count();
The client provides write_buff and read_buff to operate the buffer.
Relatively speaking, the interface is much clearer than voicechat.
Address: https://github.com/qianqians/vchat.git
Open-source voice framework vchat