Audio input capture more or less running
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user