diff --git a/src/assets/sfx/tone.wav b/src/assets/sfx/tone.wav new file mode 100755 index 0000000000000000000000000000000000000000..7fbc54cbe196e91342d24f26db9d1bea5b98c130 Binary files /dev/null and b/src/assets/sfx/tone.wav differ diff --git a/src/react-components/ui-root.js b/src/react-components/ui-root.js index a4711d14c4c29d9d5b718c04d56c1b6ad9d68d6e..517267ba8a0b42c1bcd11b423307b7e34601e79b 100644 --- a/src/react-components/ui-root.js +++ b/src/react-components/ui-root.js @@ -75,6 +75,7 @@ class UIRoot extends Component { enterInVR: false, micDevices: [], mediaStream: null, + toneInterval: null } performDirectEntryFlow = async (enterInVR) => { @@ -133,7 +134,10 @@ class UIRoot extends Component { beginAudioSetup = async () => { await this.fetchMicDevices(); - this.setState({ entryStep: ENTRY_STEPS.audio_setup }); + const playTone = () => document.querySelector("#test-tone").play(); + playTone(); + const toneInterval = setInterval(playTone, 5000); + this.setState({ toneInterval, entryStep: ENTRY_STEPS.audio_setup }); } fetchMicDevices = async () => { @@ -159,6 +163,7 @@ class UIRoot extends Component { } this.props.enterScene(mediaStream); + clearInterval(this.state.toneInterval); this.setState({ entryStep: ENTRY_STEPS.finished }); } diff --git a/src/room.html b/src/room.html index 05731ca27c45647aae83960d836e3a314557a5d0..3486ece25a603ecc837fdee587c758e3e3501bb3 100644 --- a/src/room.html +++ b/src/room.html @@ -15,6 +15,8 @@ <body> <div id="loader"></div> + <audio id="test-tone" src="./assets/sfx/tone.wav"></audio> + <a-scene networked-scene="adapter: janus; audio: true; diff --git a/webpack.config.js b/webpack.config.js index 5079ba37c391a38468f98b9c44ce35730500ca4f..ee58ffa0edc3bc26524c66ea62534b32bd8c69fb 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -114,7 +114,7 @@ module.exports = { loader: "html-loader", options: { // <a-asset-item>'s src property is overwritten with the correct transformed asset url. - attrs: ["img:src", "a-asset-item:src"], + attrs: ["img:src", "a-asset-item:src", "audio:src"], // You can get transformed asset urls in an html template using ${require("pathToFile.ext")} interpolate: "require" } @@ -142,7 +142,7 @@ module.exports = { }) }, { - test: /\.(png|jpg|gif|glb)$/, + test: /\.(png|jpg|gif|glb|wav)$/, use: { loader: "file-loader", options: {