{"_id":"audiodata","_rev":"8-dbc5dea95c56b42c16b4954024600962","name":"audiodata","description":"definition of audio data interface","dist-tags":{"latest":"1.1.0"},"versions":{"0.0.1":{"name":"audiodata","description":"isomorphic audio data decode/encode framework","version":"0.0.1","author":{"name":"Nao Yonamine","email":"mohayonao@gmail.com"},"bugs":{"url":"https://github.com/mohayonao/audiodata/issues"},"devDependencies":{"babel":"^4.7.12","browserify":"^9.0.3","espower-babel":"^1.4.0","isparta":"^2.2.0","jshint":"^2.6.3","jshint-stylish":"^1.0.1","mocha":"^2.2.1","power-assert":"^0.10.2","uglify-js":"^2.4.17"},"files":["package.json","README.md","lib"],"homepage":"https://github.com/mohayonao/audiodata/","keywords":["decode","encode","isomorphic","audio"],"licenses":"MIT","main":"./lib/index.js","repository":{"type":"git","url":"https://github.com/mohayonao/audiodata.git"},"scripts":{"build":"npm run build-to5 && npm run build-browser && npm run build-minify","build-browser":"browserify ./lib/index.js --standalone AudioData --outfile build/audiodata.js","build-minify":"uglifyjs build/audiodata.js -m -r self -o build/audiodata.min.js","build-to5":"babel src --out-dir lib","cover":"babel-node node_modules/.bin/isparta cover --report text --report html --report lcov node_modules/.bin/_mocha","lint":"jshint src test --reporter node_modules/jshint-stylish/stylish.js","test":"mocha --require espower-babel/guess","travis":"npm run lint && npm run test"},"gitHead":"14d5c86931757c6d761c76191fe7e7338cb2093b","_id":"audiodata@0.0.1","_shasum":"5b2614cfdd7af9fdc38f64392f95e47d9589c59d","_from":".","_npmVersion":"2.7.0","_nodeVersion":"0.11.14","_npmUser":{"name":"mohayonao","email":"mohayonao@gmail.com"},"maintainers":[{"name":"mohayonao","email":"mohayonao@gmail.com"}],"dist":{"shasum":"5b2614cfdd7af9fdc38f64392f95e47d9589c59d","tarball":"https://registry.npmjs.org/audiodata/-/audiodata-0.0.1.tgz","integrity":"sha512-jD4HlmOKbIvWS+iVCqhraT6nK/AnJM72aQQBwEj9M15Whja/rc6FOnchuVFBUumB5HBxKwR86hMpUUScLnCzfw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDe07z6O/7bxvBQ40CzaEYnm8erfjaJ9QVQc0pT7CO3IAiEA2anaMFQIH0gQEO/GJIEVvbzuRDsZLVLncSQlk3TMfA4="}]}},"0.0.2":{"name":"audiodata","description":"isomorphic audio data decode/encode framework","version":"0.0.2","author":{"name":"Nao Yonamine","email":"mohayonao@gmail.com"},"bugs":{"url":"https://github.com/mohayonao/audiodata/issues"},"devDependencies":{"babel":"^4.7.12","browserify":"^9.0.3","espower-babel":"^1.4.0","isparta":"^2.2.0","jshint":"^2.6.3","jshint-stylish":"^1.0.1","mocha":"^2.2.1","power-assert":"^0.10.2","uglify-js":"^2.4.17"},"files":["package.json","README.md","lib"],"homepage":"https://github.com/mohayonao/audiodata/","keywords":["decode","encode","isomorphic","audio"],"licenses":"MIT","main":"./lib/index.js","repository":{"type":"git","url":"https://github.com/mohayonao/audiodata.git"},"scripts":{"build":"npm run build-to5 && npm run build-browser && npm run build-minify","build-browser":"browserify ./lib/index.js --standalone AudioData --outfile build/audiodata.js","build-minify":"uglifyjs build/audiodata.js -m -r self -o build/audiodata.min.js","build-to5":"babel src --out-dir lib","cover":"babel-node node_modules/.bin/isparta cover --report text --report html --report lcov node_modules/.bin/_mocha","lint":"jshint src test --reporter node_modules/jshint-stylish/stylish.js","test":"mocha --require espower-babel/guess","travis":"npm run lint && npm run test"},"gitHead":"b3283f6080199c1b64929892256e2fbb03504483","_id":"audiodata@0.0.2","_shasum":"dcbc9266fb570350ff5834a5c7120cf21b0553ba","_from":".","_npmVersion":"2.7.0","_nodeVersion":"0.12.0","_npmUser":{"name":"mohayonao","email":"mohayonao@gmail.com"},"maintainers":[{"name":"mohayonao","email":"mohayonao@gmail.com"}],"dist":{"shasum":"dcbc9266fb570350ff5834a5c7120cf21b0553ba","tarball":"https://registry.npmjs.org/audiodata/-/audiodata-0.0.2.tgz","integrity":"sha512-ANWrM7BuGlRsO8cvbYkemU3aqV3MHuxRPWdA6sX04F+YRn/vmq2JoUx91hElru/veOeqOApSHym71UmtgbhjPg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCID7pMIEynG+jNchSX6NO9Ultr9iuJY3ronDumVDqG1mIAh86YBm2nV+i3ZkPu00GarpBPAq4EhqTvdOSh5ssumyD"}]}},"1.0.0":{"name":"audiodata","description":"definition of audio data interface","version":"1.0.0","author":{"name":"Nao Yonamine","email":"mohayonao@gmail.com"},"bugs":{"url":"https://github.com/mohayonao/audiodata/issues"},"devDependencies":{},"keywords":["audio","interface"],"licenses":"MIT","repository":{"type":"git","url":"https://github.com/mohayonao/audiodata.git"},"gitHead":"942c40fc0fca28addaf3ac823cc6026a815d90b6","homepage":"https://github.com/mohayonao/audiodata","_id":"audiodata@1.0.0","scripts":{},"_shasum":"6cf0f8bd1066a8a37c152d495b3ec8012d7352d9","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"mohayonao","email":"mohayonao@gmail.com"},"maintainers":[{"name":"mohayonao","email":"mohayonao@gmail.com"}],"dist":{"shasum":"6cf0f8bd1066a8a37c152d495b3ec8012d7352d9","tarball":"https://registry.npmjs.org/audiodata/-/audiodata-1.0.0.tgz","integrity":"sha512-q7+2Y0Od7PnSqon5RYPSBQDBFWyuz0xxUrUxZA7Ffi3H69XzerB96nLneSTR0mVYHwtYyJTishVjSMxUuZh+Yw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6+ECcq0zjZ1LZaVkT4iLtgMk5JZrTBwT6rBnojGmGpQIgI2K04Rk27WzjeahvqKqXqkDucvezUBrIvQRyeBTbx6c="}]}},"1.1.0":{"name":"audiodata","description":"definition of audio data interface","version":"1.1.0","author":{"name":"Nao Yonamine","email":"mohayonao@gmail.com"},"bugs":{"url":"https://github.com/mohayonao/audiodata/issues"},"dependencies":{},"devDependencies":{"eslint":"^0.22.1","espower-loader":"^0.11.0","intelli-espower-loader":"^0.7.0","mocha":"^2.2.5","power-assert":"^0.11.0","web-audio-test-api":"^0.3.0"},"files":["package.json","lib","README.md"],"keywords":["audio","audiodata","interface"],"licenses":"MIT","main":"lib/audiodata.js","repository":{"type":"git","url":"https://github.com/mohayonao/audiodata.git"},"scripts":{"lint":"eslint lib test","test":"mocha","travis":"npm run lint && npm run test"},"gitHead":"73a29193cbc8ecc48f978decb3c46108f013edb8","homepage":"https://github.com/mohayonao/audiodata","_id":"audiodata@1.1.0","_shasum":"047619572db6177ac87a76839848098ab5359e8c","_from":".","_npmVersion":"2.7.0","_nodeVersion":"0.12.0","_npmUser":{"name":"mohayonao","email":"mohayonao@gmail.com"},"maintainers":[{"name":"mohayonao","email":"mohayonao@gmail.com"}],"dist":{"shasum":"047619572db6177ac87a76839848098ab5359e8c","tarball":"https://registry.npmjs.org/audiodata/-/audiodata-1.1.0.tgz","integrity":"sha512-cf0rYgG8sEqo1187MPBzCpfh7uvPP/NIWeFNKh/md9upDgju+u3ZeYjlGFHLGfOfrsOXjLlxSUIB3mZkbKZgDA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDp2UCTqr0MrGSFS2Dx9gGJ4FRSANQCfwk0jtHskg13CQIhAJzn9jGUZ7ZxlcxUKJVcwRCxijmDw8ro2Y98Ln1Plwya"}]}}},"readme":"# audiodata\n[![Build Status](http://img.shields.io/travis/mohayonao/audiodata.svg?style=flat-square)](https://travis-ci.org/mohayonao/audiodata)\n[![NPM Version](http://img.shields.io/npm/v/audiodata.svg?style=flat-square)](https://www.npmjs.org/package/audiodata)\n[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](http://mohayonao.mit-license.org/)\n\n> definition of audio data interface\n\n## Definition\n\n```js\ninterface AudioData {\n  sampleRate: number;\n  channelData: Float32Array[];\n}\n```\n\n## Utilities\n\n```js\nfunction getSampleRate(audiodata) {\n  return audiodata.sampleRate;\n}\n\nfunction getNumberOfChannels(audiodata) {\n  return audiodata.channelData.length;\n}\n\nfunction getLength(audiodata) {\n  return audiodata.channelData[0].length;\n}\n\nfunction getDuration(audiodata) {\n  return audiodata.channelData[0].length / audiodata.sampleRate;\n}\n\nfunction getChannelData(audiodata, channels) {\n  return audiodata.channelData[channels];\n}\n\nfunction toAudioBuffer(audiodata, audioContext) {\n  var numberOfChannels = getNumberOfChannels(audiodata);\n  var length = getLength(audiodata);\n  var sampleRate = getSampleRate(audiodata);\n  var audioBuffer = audioContext.createBuffer(numberOfChannels, length, sampleRate);\n\n  for (var i = 0; i < numberOfChannels; i++) {\n    audioBuffer.getChannelData(i).set(getChannelData(audiodata, i));\n  }\n\n  return audioBuffer;\n}\n\nfunction fromAudioBuffer(audioBuffer) {\n  var sampleRate = audioBuffer.sampleRate;\n  var channelData = new Array(audioBuffer.numberOfChannels);\n\n  for (var i = 0; i < channelData.length; i++) {\n    channelData[i] = audioBuffer.getChannelData(i);\n  }\n\n  return {\n    sampleRate: sampleRate,\n    channelData: channelData\n  };\n}\n```\n\n## License\nMIT\n","maintainers":[{"name":"mohayonao","email":"mohayonao@gmail.com"}],"time":{"modified":"2022-06-13T03:43:58.171Z","created":"2015-03-16T13:24:25.640Z","0.0.1":"2015-03-16T13:24:25.640Z","0.0.2":"2015-03-17T04:59:05.704Z","1.0.0":"2015-06-09T21:52:14.320Z","1.1.0":"2015-06-11T05:21:23.700Z"},"homepage":"https://github.com/mohayonao/audiodata","keywords":["audio","audiodata","interface"],"repository":{"type":"git","url":"https://github.com/mohayonao/audiodata.git"},"author":{"name":"Nao Yonamine","email":"mohayonao@gmail.com"},"bugs":{"url":"https://github.com/mohayonao/audiodata/issues"},"readmeFilename":"README.md"}