diff --git a/audio/river/Interface.cpp b/audio/river/Interface.cpp index 6ca6433..6b0b45c 100644 --- a/audio/river/Interface.cpp +++ b/audio/river/Interface.cpp @@ -252,7 +252,7 @@ std::vector audio::river::Interface::read(size_t _nbChunk) { int32_t nbChunkBuffer = m_circularBuffer.size() / m_map.size(); m_mutex.unlock(); while (nbChunkBuffer < _nbChunk) { - usleep(1000); + std::this_thread::sleep_for(std::chrono::milliseconds(1)); nbChunkBuffer = m_circularBuffer.size() / m_map.size(); } m_mutex.lock(); diff --git a/sample/read/read.cpp b/sample/read/read.cpp index 5343444..dc5765b 100644 --- a/sample/read/read.cpp +++ b/sample/read/read.cpp @@ -12,7 +12,8 @@ //! [audio_river_sample_include] #include #include -#include +#include + //! [audio_river_sample_read_config_file] @@ -148,7 +149,7 @@ int main(int _argc, const char **_argv) { // start the stream interface->start(); // wait 10 second ... - sleep(10); + std::this_thread::sleep_for(std::chrono::seconds(10)); // stop the stream interface->stop(); //! [audio_river_sample_read_start_stop] diff --git a/sample/write/write.cpp b/sample/write/write.cpp index 69f3579..daf9eb8 100644 --- a/sample/write/write.cpp +++ b/sample/write/write.cpp @@ -10,7 +10,8 @@ #include