\r
graph_->set_color("tick-time", diagnostics::color(0.0f, 0.6f, 0.9f)); \r
graph_->set_color("dropped-frame", diagnostics::color(0.3f, 0.6f, 0.3f));\r
+ graph_->set_color("late-frame", diagnostics::color(0.6f, 0.3f, 0.3f));\r
diagnostics::register_graph(graph_);\r
\r
executor_.invoke([=]\r
}\r
\r
alSourcei(source_, AL_LOOPING, AL_FALSE);\r
+\r
+ alSourcePlay(source_); \r
});\r
}\r
\r
ALenum state; \r
alGetSourcei(source_, AL_SOURCE_STATE,&state);\r
if(state != AL_PLAYING)\r
- alSourcePlay(source_); \r
+ {\r
+ for(int n = 0; n < buffers_.size()-1; ++n)\r
+ { \r
+ ALuint buffer = 0; \r
+ alSourceUnqueueBuffers(source_, 1, &buffer);\r
+ if(buffer)\r
+ {\r
+ std::vector<int16_t> audio(format_desc_.audio_cadence[n % format_desc_.audio_cadence.size()], 0);\r
+ alBufferData(buffer, AL_FORMAT_STEREO16, audio.data(), static_cast<ALsizei>(audio.size()*sizeof(int16_t)), format_desc_.audio_sample_rate);\r
+ alSourceQueueBuffers(source_, 1, &buffer);\r
+ }\r
+ }\r
+ alSourcePlay(source_); \r
+ graph_->set_tag("late-frame"); \r
+ }\r
\r
auto audio = core::audio_32_to_16(frame.audio_data());\r
\r