Skip to content

Commit

Permalink
# This is a combination of 2 commits.
Browse files Browse the repository at this point in the history
# This is the 1st commit message:

Update to 0.2.1
 - Introduce Travis CI and Karma testing: travis.yml and karma.conf.js
 - Edited 'Test' section in README.md.
 - Fixed test-convolver unit test to support Travis CI testing.
 - Removed the unnecessary test/index.html.

# This is the commit message #2:

0.2.1
  • Loading branch information
hoch committed Apr 7, 2017
1 parent d84d958 commit ef180f9
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 46 deletions.
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
dist: trusty

language: node_js

node_js:
- 7

addons:
apt:
packages:
- google-chrome-stable

before_script:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# Omnitone: Spatial Audio on the Web

[![Build Status](https://travis-ci.org/GoogleChrome/omnitone.svg?branch=master)](https://travis-ci.org/GoogleChrome/omnitone)

Omnitone is a robust implementation of [FOA (first-order-ambisonic)](https://en.wikipedia.org/wiki/Ambisonics) decoder with binaural rendering written in Web Audio API. Its decoding process is based on multiple gain nodes for ambisonic gain matrix and convolutions for [HRTF](https://en.wikipedia.org/wiki/Head-related_transfer_function) binaural rendering, ensuring the optimum performance.

See Omnitone in action:
- __[Project Home](https://googlechrome.github.io/omnitone/#home)__
- __[JauntVR Gallery: Music](https://www.jauntvr.com/lobby/MusicLobby)__
- __[Plan8 Ambisonic Player](http://labs.plan8.se/ambisonics-webplayer/)__

- __[Forge.js](http://forgejs.org/samples/ambisonics)__

The implementation of Omnitone is based on the [Google spatial media](https://github.com/google/spatial-media) specification. The FOA input stream must be configured to ACN channel layout with SN3D normalization.
Expand All @@ -20,7 +23,7 @@ The implementation of Omnitone is based on the [Google spatial media](https://gi
+ [FOAPhaseMatchedFilter](#foaphasematchedfilter)
+ [FOAVirtualSpeaker](#foavirtualspeaker)
- [Building](#building)
- [Test](#test)
- __[Test](#test) (NEW in 0.2.1)__
- [Audio Codec compatibility](#audio-codec-compatibility)
- [Related Resources](#related-resouces)

Expand Down Expand Up @@ -280,7 +283,13 @@ npm run build-all # build a minified library and copy static resources.

## Test

Currently there is no sane way of testing web applications built with Web Audio API in the automated setting (e.g. Travis CI). To run unit tests locally, fire up the web server and load the index HTML page in the the `test` directory.
Omnitone uses [Travis](https://travis-ci.org/) and [Karma](https://karma-runner.github.io/1.0/index.html) test runner for continuous integration. (The index HTML page for the local testing is deprecated in v0.2.1.) To run the test suite locally, you have to clone the repository, install dependencies and launch the test runner:

```bash
npm test
```

Note that unit tests require the promisified version of `OfflineAudioContext`, so they might not run on outdate browsers. Omnitone's Travis CI is using the latest stable version of Chrome.


## Audio Codec Compatibility
Expand All @@ -291,7 +300,6 @@ Omnitone is designed to run any browser that supports Web Audio API, however, it
## Related Resources

* [Google Spatial Media](https://github.com/google/spatial-media)
* [VR view](https://developers.google.com/vr/concepts/vrview/)
* [Web Audio API](https://webaudio.github.io/web-audio-api/)
* [WebVR](https://webvr.info/)

Expand Down
33 changes: 33 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module.exports = function(config) {
const configuration = {
basePath: '',
frameworks: ['mocha', 'chai'],
files: [
{ pattern: 'build/resources/*.wav', included: false, served: true },
'build/omnitone.min.js',
'test/test-setup.js',
'test/*.js'
],
reporters: ['mocha'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: ['Chrome'],
customLaunchers: {
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},
singleRun: true,
concurrency: Infinity
};

// For Travis CI.
if (process.env.TRAVIS) {
configuration.browsers = ['Chrome_travis_ci'];
}

config.set(configuration);
};
16 changes: 11 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "omnitone",
"version": "0.2.0",
"version": "0.2.1",
"description": "Spatial Audio Decoder in Web Audio API",
"main": "build/omnitone.js",
"keywords": [
Expand All @@ -11,15 +11,21 @@
"Web Audio API"
],
"devDependencies": {
"copy-webpack-plugin": "^3.0.1",
"webpack": "^1.13.0",
"chai": "^3.5.0",
"mocha": "^3.0.0"
"copy-webpack-plugin": "^3.0.1",
"karma": "^1.6.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^2.0.0",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.3",
"mocha": "^3.0.0",
"webpack": "^1.13.0"
},
"scripts": {
"build": "webpack --progress --color",
"watch": "webpack --progress --color --watch",
"build-all": "webpack --config webpack.config.all.js --progress --color"
"build-all": "webpack --config webpack.config.all.js --progress --color",
"test": "node_modules/karma/bin/karma start"
},
"homepage": "https://github.com/GoogleChrome/omnitone",
"bugs": {
Expand Down
37 changes: 0 additions & 37 deletions test/index.html

This file was deleted.

2 changes: 1 addition & 1 deletion test/test-convolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('FOAConvolver', function () {

Omnitone.loadAudioBuffers(context, [{
name: 'SH-MaxRe',
url: '../build/resources/sh_hrir_o_1.wav'
url: 'base/build/resources/sh_hrir_o_1.wav'
}]).then(function (buffers) {
foaSHMaxREBuffer = buffers.get('SH-MaxRe');
done();
Expand Down

0 comments on commit ef180f9

Please sign in to comment.