[DEV] correct playing of audio music
This commit is contained in:
parent
f580ec38e3
commit
ccc8460635
@ -30,10 +30,10 @@ void audio::ess::LoadedFile::threadCall() {
|
||||
}
|
||||
|
||||
void audio::ess::LoadedFile::decode() {
|
||||
EWOLSA_INFO("Start decode OGG : " << m_file);
|
||||
EWOLSA_ERROR("Start decode OGG : " << m_file);
|
||||
m_data = audio::ess::ogg::loadAudioFile(m_file, m_nbChanRequested);
|
||||
m_nbSamples = m_data.size();
|
||||
EWOLSA_INFO("End decode OGG : " << m_file << " size=" << m_nbSamples);
|
||||
EWOLSA_ERROR("End decode OGG : " << m_file << " size=" << m_nbSamples);
|
||||
}
|
||||
|
||||
audio::ess::LoadedFile::LoadedFile(const std::string& _fileName, int8_t _nbChanRequested) :
|
||||
@ -57,7 +57,7 @@ audio::ess::LoadedFile::LoadedFile(const std::string& _fileName, int8_t _nbChanR
|
||||
#else
|
||||
m_thread = std11::make_shared<std11::thread>(&audio::ess::LoadedFile::threadCall, this);
|
||||
if (m_thread == nullptr) {
|
||||
GALE_ERROR("Can not create thread ...");
|
||||
EWOLSA_ERROR("Can not create thread ...");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
@ -68,7 +68,6 @@ void audio::ess::Music::onDataNeeded(void* _data,
|
||||
if (_format != audio::format_int16) {
|
||||
EWOLSA_ERROR("call wrong type ... (need int16_t)");
|
||||
}
|
||||
return;
|
||||
std::unique_lock<std::mutex> lock(m_mutex);
|
||||
if (m_current != m_next) {
|
||||
EWOLSA_INFO("change track " << (m_current==nullptr?-1:m_current->getUId()) << " ==> " << (m_next==nullptr?-1:m_next->getUId()));
|
||||
@ -86,7 +85,7 @@ void audio::ess::Music::onDataNeeded(void* _data,
|
||||
processTimeMax = std::max(0, processTimeMax);
|
||||
int16_t * pointer = static_cast<int16_t*>(_data);
|
||||
int16_t * newData = &m_current->m_data[m_position];
|
||||
EWOLSA_DEBUG("AUDIO : Play slot... nb sample : " << processTimeMax << " map=" << _map << " _nbChunk=" << _nbChunk);
|
||||
EWOLSA_VERBOSE("AUDIO : Play slot... nb sample : " << processTimeMax << " map=" << _map << " _nbChunk=" << _nbChunk);
|
||||
for (int32_t iii=0; iii<processTimeMax; iii++) {
|
||||
*pointer++ = *newData++;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user