git-svn-id: svn://elaine/murooma/trunk@25 d8a302eb-03bc-478d-80e4-98257eca68ef
This commit is contained in:
(no author) 2014-06-28 20:30:27 +00:00
parent fa67bad1e3
commit a6b5ef2f0e
2 changed files with 21 additions and 15 deletions

20
chunk.h Normal file
View file

@ -0,0 +1,20 @@
#ifndef CHUNK_H
#define CHUNK_H
#define MS (50)
//44100 / 20 = 2205
#define SAMPLE_RATE (44100)
#define SIZE (SAMPLE_RATE*4*MS/1000)
int bufferMs;
#define FRAMES_PER_BUFFER (SIZE/4)
struct Chunk
{
int32_t tv_sec;
int32_t tv_usec;
char payload[SIZE];
};
#endif

View file

@ -17,23 +17,9 @@
#include <mutex> #include <mutex>
#include <condition_variable> #include <condition_variable>
#include <portaudio.h> #include <portaudio.h>
#include "chunk.h"
#define MS (50)
//44100 / 20 = 2205
#define SAMPLE_RATE (44100)
#define SIZE (SAMPLE_RATE*4*MS/1000)
int bufferMs;
#define FRAMES_PER_BUFFER (SIZE/4)
struct Chunk
{
int32_t tv_sec;
int32_t tv_usec;
char payload[SIZE];
};
std::deque<Chunk*> chunks; std::deque<Chunk*> chunks;
std::deque<int> timeDiffs; std::deque<int> timeDiffs;
std::mutex mtx; std::mutex mtx;