|
|
@ -66,8 +66,7 @@ string AudioClip::toString() { |
|
|
|
char buf[64] = {0}; |
|
|
|
strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", &tm); |
|
|
|
|
|
|
|
string str = fmt::format("audio:{} c-{} r-{} f-{} {}:{}", buf, m_ch, m_rate, AudioFormatToStr(m_format), |
|
|
|
(void *)m_voice, m_voicebufsize); |
|
|
|
string str = fmt::format("audio:{} c-{} r-{} f-{} {}:{}", buf, m_ch, m_rate, AudioFormatToStr(m_format), (void *)m_voice, m_voicebufsize); |
|
|
|
return str; |
|
|
|
} |
|
|
|
|
|
|
@ -84,3 +83,9 @@ void AudioClip::getOneCHVoice(vector<uint8_t> &voice, size_t ch) { |
|
|
|
memcpy(&voice[i * oneframebytes], &m_voice[i * m_ch * oneframebytes + ch * oneframebytes], oneframebytes); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
shared_ptr<AudioClip> AudioClip::getOneCHVoice(size_t ch) { |
|
|
|
vector<uint8_t> voice; |
|
|
|
getOneCHVoice(voice, ch); |
|
|
|
return make_shared<AudioClip>(voice.data(), voice.size(), 1, m_rate, m_format); |
|
|
|
} |