mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 01:13:32 +02:00
Check _currentSendPosition instead of overriding
This commit is contained in:
parent
dfe70ed2e3
commit
5a8b9082b2
2 changed files with 7 additions and 4 deletions
libraries/audio/src
|
@ -44,11 +44,14 @@ void AudioInjector::setOptions(AudioInjectorOptions& options) {
|
|||
|
||||
const uchar MAX_INJECTOR_VOLUME = 0xFF;
|
||||
|
||||
void AudioInjector::injectAudio(int startingPosition) {
|
||||
_currentSendPosition = startingPosition;
|
||||
|
||||
void AudioInjector::injectAudio() {
|
||||
QByteArray soundByteArray = _sound->getByteArray();
|
||||
|
||||
if (_currentSendPosition < 0 ||
|
||||
_currentSendPosition >= soundByteArray.size()) {
|
||||
_currentSendPosition = 0;
|
||||
}
|
||||
|
||||
// make sure we actually have samples downloaded to inject
|
||||
if (soundByteArray.size()) {
|
||||
// give our sample byte array to the local audio interface, if we have it, so it can be handled locally
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
|
||||
int getCurrentSendPosition() const { return _currentSendPosition; }
|
||||
public slots:
|
||||
void injectAudio(int startingPosition = 0);
|
||||
void injectAudio();
|
||||
void stop() { _shouldStop = true; }
|
||||
void setOptions(AudioInjectorOptions& options);
|
||||
void setCurrentSendPosition(int currentSendPosition) { _currentSendPosition = currentSendPosition; }
|
||||
|
|
Loading…
Reference in a new issue