Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
temporarily disable loud sounds for now (fixes issue #751)
Browse files Browse the repository at this point in the history
  • Loading branch information
cvan committed Nov 22, 2018
1 parent 2fbe10a commit b66f37d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
28 changes: 14 additions & 14 deletions app/src/common/shared/org/mozilla/vrbrowser/VRBrowserActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import org.mozilla.geckoview.CrashReporter;
import org.mozilla.geckoview.GeckoRuntime;
import org.mozilla.geckoview.GeckoSession;
import org.mozilla.vrbrowser.audio.AudioEngine;
// import org.mozilla.vrbrowser.audio.AudioEngine;
import org.mozilla.vrbrowser.audio.VRAudioTheme;
import org.mozilla.vrbrowser.browser.PermissionDelegate;
import org.mozilla.vrbrowser.browser.SessionStore;
Expand Down Expand Up @@ -100,7 +100,7 @@ public void run() {
static final String LOGTAG = "VRB";
HashMap<Integer, Widget> mWidgets;
private int mWidgetHandleIndex = 1;
AudioEngine mAudioEngine;
// AudioEngine mAudioEngine;
OffscreenDisplay mOffscreenDisplay;
FrameLayout mWidgetContainer;
int mLastGesture;
Expand Down Expand Up @@ -167,12 +167,12 @@ protected void onCreate(Bundle savedInstanceState) {

mPermissionDelegate = new PermissionDelegate(this, this);

mAudioEngine = new AudioEngine(this, new VRAudioTheme());
mAudioEngine.preloadAsync(() -> {
Log.i(LOGTAG, "AudioEngine sounds preloaded!");
// mAudioEngine.playSound(AudioEngine.Sound.AMBIENT, true);
});
mAudioUpdateRunnable = () -> mAudioEngine.update();
// mAudioEngine = new AudioEngine(this, new VRAudioTheme());
// mAudioEngine.preloadAsync(() -> {
// Log.i(LOGTAG, "AudioEngine sounds preloaded!");
// // mAudioEngine.playSound(AudioEngine.Sound.AMBIENT, true);
// });
// mAudioUpdateRunnable = () -> mAudioEngine.update();

loadFromIntent(getIntent());
queueRunnable(() -> createOffscreenDisplay());
Expand Down Expand Up @@ -242,15 +242,15 @@ protected void onPause() {
// Also prevents a deadlock in onDestroy when the BrowserWidget is released.
exitImmersiveSync();
}
mAudioEngine.pauseEngine();
// mAudioEngine.pauseEngine();
SessionStore.get().setActive(false);
super.onPause();
}

@Override
protected void onResume() {
SessionStore.get().setActive(true);
mAudioEngine.resumeEngine();
// mAudioEngine.resumeEngine();
super.onResume();
}

Expand All @@ -267,9 +267,9 @@ protected void onDestroy() {
if (mOffscreenDisplay != null) {
mOffscreenDisplay.release();
}
if (mAudioEngine != null) {
mAudioEngine.release();
}
// if (mAudioEngine != null) {
// mAudioEngine.release();
// }
if (mPermissionDelegate != null) {
mPermissionDelegate.release();
}
Expand Down Expand Up @@ -528,7 +528,7 @@ void handleBack() {
@Keep
@SuppressWarnings({"UnusedDeclaration"})
void handleAudioPose(float qx, float qy, float qz, float qw, float px, float py, float pz) {
mAudioEngine.setPose(qx, qy, qz, qw, px, py, pz);
// mAudioEngine.setPose(qx, qy, qz, qw, px, py, pz);

// https://developers.google.com/vr/reference/android/com/google/vr/sdk/audio/GvrAudioEngine.html#resume()
// The initialize method must be called from the main thread at a regular rate.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.mozilla.geckoview.GeckoView;
import org.mozilla.gecko.util.GeckoBundle;
import org.mozilla.vrbrowser.SessionStore;
import org.mozilla.vrbrowser.audio.AudioEngine;
// import org.mozilla.vrbrowser.audio.AudioEngine;
import org.mozilla.vrbrowser.audio.VRAudioTheme;
import org.mozilla.vrbrowser.ui.NavigationBarWidget;

Expand All @@ -36,7 +36,7 @@ public class BrowserActivity extends Activity implements SessionStore.SessionCha
private GeckoView mGeckoView;
private GeckoSession mGeckoSession;
private NavigationBarWidget mBrowserHeader;
private AudioEngine mAudioEngine;
// private AudioEngine mAudioEngine;


@Override
Expand All @@ -46,8 +46,8 @@ protected void onCreate(Bundle savedInstanceState) {

SessionStore.get().setContext(this);

mAudioEngine = new AudioEngine(this, new VRAudioTheme());
mAudioEngine.preloadAsync();
// mAudioEngine = new AudioEngine(this, new VRAudioTheme());
// mAudioEngine.preloadAsync();

setContentView(R.layout.browser_activity);
mBrowserHeader = findViewById(R.id.browserHeader);
Expand Down Expand Up @@ -107,7 +107,7 @@ protected void onPause() {
if (mGeckoView != null) {
mGeckoView.releaseSession();
}
mAudioEngine.pauseEngine();
// mAudioEngine.pauseEngine();
super.onPause();
}

Expand All @@ -121,7 +121,7 @@ protected void onResume() {
}
mGeckoView.requestFocus();
}
mAudioEngine.resumeEngine();
// mAudioEngine.resumeEngine();
super.onResume();
}

Expand All @@ -131,7 +131,7 @@ protected void onDestroy() {
if (mBrowserHeader != null) {
mBrowserHeader.releaseWidget();
}
mAudioEngine.release();
// mAudioEngine.release();
SessionStore.get().removeSessionChangeListener(this);
super.onDestroy();
}
Expand Down

0 comments on commit b66f37d

Please sign in to comment.