audiobuffer.h
来自「kphone-4.2,SHELL协议的VOIP电话」· C头文件 代码 · 共 47 行
H
47 行
#ifndef AUDIOBUFFER_H_INCLUDED#define AUDIOBUFFER_H_INCLUDED#include <stdlib.h>/** * Small class for passing around buffers of audio data. Does not * specify a format, so the responsibility is on the programmer to * know what the datatype of the buffer really is. */class AudioBuffer{public: /** * Creates an audio buffer of @param length bytes. */ AudioBuffer( size_t length = 4096 ); /** * Deletes the audio buffer, freeing the data. */ ~AudioBuffer( void ); /** * Returns a pointer to the audio data. */ void *getData( void ) const { return data; } /** * Returns the size of the buffer. */ size_t getSize( void ) const { return size; } /** * Resizes the buffer to size newlength. Will only allocate new memory * if the size is larger than what has been previously allocated. */ void resize( size_t newsize );private: void *data; size_t size; size_t realsize;};#endif // AUDIOBUFFER_H_INCLUDED
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?