Skip to content

Commit

Permalink
Merge pull request #20 from DeekyJay/howler-fix
Browse files Browse the repository at this point in the history
Fixed Howler Issues With Buffer, No Playback, and Global Volume
  • Loading branch information
DeekyJay authored Dec 1, 2016
2 parents 883f4e0 + 4a1b264 commit d571152
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SoundwaveInteractive",
"version": "0.9.7",
"version": "0.9.8",
"description": "Soundwave Interactive Beam Soundboard",
"main": "main.js",
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class Audio extends React.Component {
<div
className='form-group'
onClick={this.checkChanged}>
<span className='checkbox-label'>Minimize to system tray</span>
<span className='checkbox-label'>Minimize to System Tray</span>
<span className={`custom-checkbox ${trayMinimize ? 'sicon-round-check' : ''}`}></span>
</div>
</div>
Expand Down
5 changes: 3 additions & 2 deletions src/containers/SoundList.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import SoundItem from '../components/SoundItem/SoundItem'
import ReactToolTip from 'react-tooltip'
import Dropzone from 'react-dropzone'
import { SortableContainer, SortableElement } from 'react-sortable-hoc'
import { Howl } from 'howler'
import { Howl, Howler } from 'howler'
console.log(Howler)
import { toastr } from 'redux-toastr'
import ReactSlider from 'rc-slider'
import Ink from '../components/Ink'
Expand Down Expand Up @@ -172,7 +173,7 @@ export class SoundList extends React.Component {
html5: true,
volume: parseFloat(sound.volume) * 0.01
})
if (selectedOutput) howl._audioNode[0].setSinkId(selectedOutput)
if (selectedOutput) howl._sounds[0]._node.setSinkId(selectedOutput)
howl.once('end', () => {
howl.unload()
this.setState({ ...this.state, isPlaying: false, howl: null })
Expand Down
10 changes: 6 additions & 4 deletions src/redux/modules/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { remote, ipcRenderer } from 'electron'
import _ from 'lodash'
import storage from 'electron-json-storage'
import { Howler } from 'howler'
Howler.usingWebAudio = false
import { shareAnalytics } from '../utils/analytics'

const { BrowserWindow, app } = remote
Expand Down Expand Up @@ -66,6 +67,7 @@ export const actions = {
data.shareAnalytics !== null) shareAnalytics(data.shareAnalytics)
ipcDispatch = dispatch
console.log(data)
if (data.globalVolume) Howler.volume(parseInt(data.globalVolume) * 0.01)
dispatch({
type: constants.APP_INITIALIZE,
payload: data
Expand All @@ -85,10 +87,10 @@ export const actions = {
})
})
} else {
mainWindow.minimize()
dispatch({
type: constants.MINIMIZE
})
mainWindow.minimize()
dispatch({
type: constants.MINIMIZE
})
}
}
},
Expand Down
4 changes: 1 addition & 3 deletions src/redux/modules/Sounds.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { actions as interactiveActions } from './Interactive'
import { actions as boardActions } from './Board'
import analytics from '../utils/analytics'
import { Howl, Howler } from 'howler'
Howler.usingWebAudio = true
Howler.ctx = true
// Constants
export const constants = {
SOUNDS_INITIALIZE: 'SOUNDS_INITIALIZE',
Expand Down Expand Up @@ -140,7 +138,7 @@ export const actions = {
html5: true,
volume: parseFloat(sound.volume) * 0.01
})
if (selectedOutput) howl._audioNode[0].setSinkId(selectedOutput)
if (selectedOutput) howl._sounds[0]._node.setSinkId(selectedOutput)
howl.once('end', () => {
howl.unload()
dispatch({ type: constants.PLAY_SOUND_ENDED })
Expand Down
6 changes: 0 additions & 6 deletions src/redux/utils/Howler.js

This file was deleted.

0 comments on commit d571152

Please sign in to comment.