Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/common-app/src/examples/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,5 @@ export const Examples: Example[] = [
title: 'Streamer',
subtitle: 'Stream audio from a URL',
screen: Streaming,
}
},
] as const;
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ void AudioBufferQueueSourceNode::stop(double when) {
isPaused_ = false;
}

void AudioBufferQueueSourceNode::start(double when) {
isPaused_ = false;
stopTime_ = -1.0;
AudioScheduledSourceNode::start(when);
}

void AudioBufferQueueSourceNode::pause() {
AudioScheduledSourceNode::stop(0.0);
isPaused_ = true;
Expand Down Expand Up @@ -79,6 +85,7 @@ void AudioBufferQueueSourceNode::disable() {
playbackState_ = PlaybackState::UNSCHEDULED;
startTime_ = -1.0;
stopTime_ = -1.0;
isPaused_ = false;

return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class AudioBufferQueueSourceNode : public AudioBufferBaseSourceNode {
~AudioBufferQueueSourceNode() override;

void stop(double when) override;
void start(double when) override;
void pause();

std::string enqueueBuffer(const std::shared_ptr<AudioBuffer> &buffer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ void AudioScheduledSourceNode::updatePlaybackInfo(
size_t stopFrame = stopTime_ == -1.0
? std::numeric_limits<size_t>::max()
: dsp::timeToSampleFrame(stopTime_, sampleRate);

if (isFinished()) {
startOffset = 0;
nonSilentFramesToProcess = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class AudioScheduledSourceNode : public AudioNode {
enum class PlaybackState { UNSCHEDULED, SCHEDULED, PLAYING, STOP_SCHEDULED, FINISHED };
explicit AudioScheduledSourceNode(BaseAudioContext *context);

void start(double when);
virtual void start(double when);
virtual void stop(double when);

bool isUnscheduled();
Expand Down