Audio input capture more or less running

This commit is contained in:
xenakios
2017-11-13 22:35:36 +02:00
parent c32e64a570
commit 76de3b12a5
7 changed files with 82 additions and 11 deletions

View File

@ -116,6 +116,14 @@ void StretchAudioSource::setLoopingEnabled(bool b)
}
}
void StretchAudioSource::setAudioBufferAsInputSource(AudioBuffer<float>* buf, int sr, int len)
{
std::lock_guard <std::mutex> locker(m_mutex);
m_inputfile->setAudioBuffer(buf, sr, len);
m_seekpos = 0.0;
m_lastinpos = 0.0;
}
void StretchAudioSource::getNextAudioBlock(const AudioSourceChannelInfo & bufferToFill)
{
// for realtime play, this is assumed to be used with BufferingAudioSource, so mutex locking should not be too bad...
@ -489,6 +497,12 @@ std::pair<Range<double>, Range<double>> MultiStretchAudioSource::getFileCachedRa
return getActiveStretchSource()->getFileCachedRangesNormalized();
}
void MultiStretchAudioSource::setAudioBufferAsInputSource(AudioBuffer<float>* buf, int sr, int len)
{
m_stretchsources[0]->setAudioBufferAsInputSource(buf, sr, len);
m_stretchsources[1]->setAudioBufferAsInputSource(buf, sr, len);
}
StretchAudioSource * MultiStretchAudioSource::getActiveStretchSource() const
{
return m_stretchsources[0].get();