Commit 4baf8920 authored by Karan Goel's avatar Karan Goel
Browse files

more code

parent 86f076fd
var fs = require('fs');
var http = require('http');
var url = require('url');
var tessel = require('tessel');
var audio = require('audio-vs1053b').use(tessel.port['A']);
var scURL = 'https://api.soundcloud.com/tracks/185716083.json?consumer_key=apigee';
var parsedSCURL = url.parse(scURL);
var options = {
host: parsedSCURL.host,
port: 80,
path: parsedSCURL.pathname + '?client_id=apigee'
};
// console.log(options);
// Wait for the module to connect
// audio.on('ready', function() {
// console.log("Audio module connected! Setting volume...");
// Set the volume in decibels. Around .8 is good; 80% max volume or -25db
// audio.setVolume(.8, function(err) {
// if (err) {
// return console.log(err);
// }
// Get the song
console.log('Retrieving song...');
http.get(scURL, function(responseFromSC) {
console.log(responseFromSC.statusCode);
responseFromSC.on('data', function (body) {
var mediaLocation = JSON.parse(body).stream_url;
console.log(mediaLocation);
var parsedMediaURL = url.parse(mediaLocation);
var options = {
host: parsedMediaURL.host,
port: 80,
path: parsedMediaURL.pathname + '?consumer_key=apigee'
};
console.log(options);
http.get(options, function(responseFromMedia) {
// And stream it back to the client
console.log('streaming streaming');
console.log(responseFromMedia);
audio.play(song, function(err) {
if (err) {
console.log(err);
} else {
console.log('Done playing', audioFile);
}
});
});
});
}).on('error', function(error) {
// If we can't get to the SC API server then respond with a 404
console.log('ERRORED');
console.log(error);
});
// });
// });
// If there is an error, report it
// audio.on('error', function(err) {
// console.log(err);
// });
node_modules
*.elf
*.hex
*.lss
*.lst
*.o
*.map
*.sym
*.eep
.dep
The Audio Module project is copyright 2014
Technical Machine, Inc.
Licensed under the Apache License, Version 2.0
<LICENSE-APACHE or
http://www.apache.org/licenses/LICENSE-2.0> or the MIT
license <LICENSE-MIT or http://opensource.org/licenses/MIT>,
at your option. All files in the project carrying such
notice may not be copied, modified, or distributed except
according to those terms.
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Copyright (c) 2013-2014 Technical Machine, Inc
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
#Audio
Driver for the audio-vs1053b Tessel audio module. The hardware documentation for this module can be found [here](https://github.com/tessel/hardware/blob/master/modules-overview.md#audio).
If you run into any issues you can ask for support on the [Audio Module Forums](http://forums.tessel.io/category/audio).
###Installation
```sh
npm install audio-vs1053b
```
###Limitations
The current version of the Tessel runtime is too slow to play audio files smoothly. That means we wrote a custom C shim that handles most of the playback and recording of data. There are several consequences of the C shim:
* Any other modules that use SPI for communication will be blocked while the Audio Module is playing a buffer.
* You can only have one Audio Module attached to Tessel at a time.
* Updates to the Audio Module driver must be released in both firmware and this npm repo.
It sucks but we're expecting major runtime speed improvements to render the C shim unnecessary within the next couple of months.
###Development Status
Playback and recording to/from the local file system works well. Streams work less well. Interacting with the SDCard, Ambient, and IR doesn't work yet (issues with the SPI bus). This module is currently undergoing heavy development to fix those issues. Please file any bugs you find with this module.
###Example
```js
/*********************************************
This Audio Module demo sets volume, then plays
an audio file out over Headphones/Line out
*********************************************/
var tessel = require('tessel');
var fs = require('fs');
var audio = require('audio-vs1053b').use(tessel.port['A']);
var audioFile = 'sample.mp3';
// Wait for the module to connect
audio.on('ready', function() {
console.log("Audio module connected! Setting volume...");
// Set the volume in decibels. Around 20 is good; smaller is louder.
audio.setVolume(20, function(err) {
if (err) {
return console.log(err);
}
// Get the song
console.log('Retrieving file...');
var song = fs.readFileSync(audioFile);
// Play the song
console.log('Playing ' + audioFile + '...');
audio.play(song, function(err) {
if (err) {
console.log(err);
} else {
console.log('Done playing', audioFile);
}
});
});
});
// If there is an error, report it
audio.on('error', function(err) {
console.log(err);
});
```
###Methods
&#x20;<a href="#api-audio-setVolume-leftChannelDb-rightChannelDb-callback-err-Set-the-output-volume-Level-is-a-Number-from-0-0-to-1-0" name="api-audio-setVolume-leftChannelDb-rightChannelDb-callback-err-Set-the-output-volume-Level-is-a-Number-from-0-0-to-1-0">#</a> audio<b>.setVolume</b>( leftChannelDb, [rightChannelDb,] callback(err) )
Set the output volume. Level is a Number from 0.0 to 1.0
&#x20;<a href="#api-audio-setInput-input-callback-err-Set-the-input-to-either-lineIn-or-mic-Defaults-to-lineIn" name="api-audio-setInput-input-callback-err-Set-the-input-to-either-lineIn-or-mic-Defaults-to-lineIn">#</a> audio<b>.setInput</b>( input, callback(err) )
Set the input to either 'lineIn' or 'mic'. Defaults to 'lineIn'.
&#x20;<a href="#api-audio-setOutput-output-callback-err-Set-the-output-to-either-lineOut-or-headPhones-Defaults-to-lineOut" name="api-audio-setOutput-output-callback-err-Set-the-output-to-either-lineOut-or-headPhones-Defaults-to-lineOut">#</a> audio<b>.setOutput</b>( output, callback(err) )
Set the output to either 'lineOut' or 'headPhones'. Defaults to 'lineOut'.
&#x20;<a href="#api-audio-startRecording-profile-callback-err-Start-recording-sound-from-the-input-Receive-data-in-the-data-event-Callback-called-after-recording-initialized-not-stopped-quality-is-an-optional-argument-that-can-be-voice-wideband-voice-wideband-stereo-hifi-voice-or-stereo-music-Default-is-hifi-voice" name="api-audio-startRecording-profile-callback-err-Start-recording-sound-from-the-input-Receive-data-in-the-data-event-Callback-called-after-recording-initialized-not-stopped-quality-is-an-optional-argument-that-can-be-voice-wideband-voice-wideband-stereo-hifi-voice-or-stereo-music-Default-is-hifi-voice">#</a> audio<b>.startRecording</b>( [profile] callback(err) )
Start recording sound from the input. (Receive data in the 'data' event) Callback called after recording initialized (not stopped ) .quality is an optional argument that can be 'voice', 'wideband-voice', 'wideband-stereo', 'hifi-voice', or 'stereo-music'. Default is 'hifi-voice'.
&#x20;<a href="#api-audio-stopRecording-callback-err-Stop-recording-sound-note-that-may-receive-one-more-data-event-before-this-completes-when-the-buffer-is-flushed" name="api-audio-stopRecording-callback-err-Stop-recording-sound-note-that-may-receive-one-more-data-event-before-this-completes-when-the-buffer-is-flushed">#</a> audio<b>.stopRecording</b>( callback(err) )
Stop recording sound (note that may receive one more 'data' event before this completes when the buffer is flushed. )
&#x20;<a href="#api-audio-play-audioBuff-callback-err-Play-a-buffer-If-no-buffer-is-passed-in-the-module-will-attempt-to-resume-a-buffer-that-was-paused" name="api-audio-play-audioBuff-callback-err-Play-a-buffer-If-no-buffer-is-passed-in-the-module-will-attempt-to-resume-a-buffer-that-was-paused">#</a> audio<b>.play</b>( [audioBuff], callback(err) )
Play a buffer. If no buffer is passed in, the module will attempt to resume a buffer that was paused.
&#x20;<a href="#api-audio-pause-callback-err-Pause-the-buffer" name="api-audio-pause-callback-err-Pause-the-buffer">#</a> audio<b>.pause</b>( callback(err) )
Pause the buffer.
&#x20;<a href="#api-audio-stop-callback-err-Stop-playing-and-flush-the-buffer" name="api-audio-stop-callback-err-Stop-playing-and-flush-the-buffer">#</a> audio<b>.stop</b>( callback(err) )
Stop playing and flush the buffer.
&#x20;<a href="#api-audio-createPlayStream-Returns-a-stream-that-a-buffer-can-be-piped-into-to-play-audio" name="api-audio-createPlayStream-Returns-a-stream-that-a-buffer-can-be-piped-into-to-play-audio">#</a> audio<b>.createPlayStream</b>()
Returns a stream that a buffer can be piped into to play audio.
&#x20;<a href="#api-audio-createRecordStream-Returns-a-readable-stream-of-mic-data" name="api-audio-createRecordStream-Returns-a-readable-stream-of-mic-data">#</a> audio<b>.createRecordStream</b>()
Returns a readable stream of mic data.
&#x20;<a href="#api-audio-availableRecordingProfiles-Returns-an-array-of-available-profiles" name="api-audio-availableRecordingProfiles-Returns-an-array-of-available-profiles">#</a> audio<b>.availableRecordingProfiles</b>()
Returns an array of available profiles.
###Events
&#x20;<a href="#api-audio-on-ready-callback-The-audio-module-is-ready-to-use" name="api-audio-on-ready-callback-The-audio-module-is-ready-to-use">#</a> audio<b>.on</b>( 'ready', callback() )
The audio module is ready to use.
&#x20;<a href="#api-audio-on-error-callback-err-The-audio-module-had-an-error-on-connection" name="api-audio-on-error-callback-err-The-audio-module-had-an-error-on-connection">#</a> audio<b>.on</b>( 'error', callback(err) )
The audio module had an error on connection.
&#x20;<a href="#api-audio-on-volume-callback-volume-Volume-was-set" name="api-audio-on-volume-callback-volume-Volume-was-set">#</a> audio<b>.on</b>( 'volume', callback(volume) )
Volume was set.
&#x20;<a href="#api-audio-on-input-callback-input-The-input-mode-was-set" name="api-audio-on-input-callback-input-The-input-mode-was-set">#</a> audio<b>.on</b>( 'input', callback(input) )
The input mode was set.
&#x20;<a href="#api-audio-on-output-callback-output-The-output-mode-was-set" name="api-audio-on-output-callback-output-The-output-mode-was-set">#</a> audio<b>.on</b>( 'output', callback(output) )
The output mode was set.
&#x20;<a href="#api-audio-on-startRecording-callback-Started-recording-from-the-input" name="api-audio-on-startRecording-callback-Started-recording-from-the-input">#</a> audio<b>.on</b>( 'startRecording', callback() )
Started recording from the input.
&#x20;<a href="#api-audio-on-data-callback-audioBuff-Received-recorded-data" name="api-audio-on-data-callback-audioBuff-Received-recorded-data">#</a> audio<b>.on</b>( 'data', callback(audioBuff) )
Received recorded data.
&#x20;<a href="#api-audio-on-stopRecording-callback-Stopped-recording-on-the-input" name="api-audio-on-stopRecording-callback-Stopped-recording-on-the-input">#</a> audio<b>.on</b>( 'stopRecording', callback() )
Stopped recording on the input.
&#x20;<a href="#api-audio-on-play-callback-A-buffer-is-beginning-to-be-played" name="api-audio-on-play-callback-A-buffer-is-beginning-to-be-played">#</a> audio<b>.on</b>( play', callback() )
A buffer is beginning to be played.
&#x20;<a href="#api-audio-on-pause-callback-Playback-was-paused" name="api-audio-on-pause-callback-Playback-was-paused">#</a> audio<b>.on</b>( 'pause', callback() )
Playback was paused.
&#x20;<a href="#api-audio-on-stop-callback-Playback-was-stopped" name="api-audio-on-stop-callback-Playback-was-stopped">#</a> audio<b>.on</b>( 'stop', callback() )
Playback was stopped.
&#x20;<a href="#api-audio-on-end-callback-err-The-buffer-finished-playing" name="api-audio-on-end-callback-err-The-buffer-finished-playing">#</a> audio<b>.on</b>( 'end', callback(err) )
The buffer finished playing.
###Further Examples
* [Audio Out No Streams](https://github.com/tessel/audio-vs1053b/blob/master/examples/audio-out-no-streams.js). This Audio Module demo sends audio from a file to Headphones/Line out without using streams..
* [Record Sound](https://github.com/tessel/audio-vs1053b/blob/master/examples/record-sound.js). This Audio Module demo sends audio from the microphone to a file without using streams.
* [Stream Audio Out](https://github.com/tessel/audio-vs1053b/blob/master/examples/stream-audio-out.js). This Audio Module demo sends audio from a file to Headphones/Line out using streams.
* [Stream Sound to File](https://github.com/tessel/audio-vs1053b/blob/master/examples/stream-sound-to-file.js). This Audio Module demo takes line-in and writes it to a file using streams.
###License
MIT or Apache 2.0, at your option
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/publicdomain/zero/1.0/
/*********************************************
This Audio Module demo sends audio from a file
to Headphones/Line out without using streams.
*********************************************/
var tessel = require('tessel');
var fs = require('fs');
var audio = require('../').use(tessel.port['A']); // Replace '../' with 'audio-vs1053b' in your own code
audio.on('ready', function () { // Start recording data for a second into a file
audio.setOutput('headphone', function(err) {
// Open a file
var audioFile = fs.readFileSync('sample.mp3');
// Play the file
audio.play(audioFile);
});
});
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/publicdomain/zero/1.0/
/*********************************************
This Audio Module demo will record audio through
the mic while the CONFIG button is held down.
When the CONFIG button is released, the recorded
audio will be played back through the audio
out jack.
*********************************************/
var tessel = require('tessel');
var audio = require('../').use(tessel.port['A']); // Replace '../' with 'audio-vs1053b' in your own code
var chunks = [];
// When we get data, push it into our array
audio.on('data', function(data) {
chunks.push(data);
});
// Wait for the module to connect
audio.on('ready', function() {
console.log('Hold the config button to record...');
// When the config button is pressed, start recording
tessel.button.once('press', startRecording);
});
function startRecording() {
// Tell the audio module to start recording
audio.startRecording('voice', function() {
console.log('Recording...');
// Once the button is released, stop recording
tessel.button.once('release', stopRecording);
});
}
function stopRecording() {
// Tell the audio module to stop recording
console.log('stopping the recording...');
audio.stopRecording(function() {
console.log('Playing it back...');
// Concat the data and play it
audio.play(Buffer.concat(chunks), function(err) {
// When we're done playing, clear recordings
chunks = [];
console.log('Hold the config button to record...');
// Wait for a button press again
tessel.button.once('press', startRecording);
});
});
}
// If there is an error, report it
audio.on('error', function(err) {
throw err;
});
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/publicdomain/zero/1.0/
/*********************************************
This Audio Module demo sends audio from the
microphone to a file without using streams.
*********************************************/
var tessel = require('tessel');
var fs = require('fs');
var audio = require('../').use(tessel.port['A']); // Replace '../' with 'audio-vs1053b' in your own code
audio.on('ready', function () {
// Start recording data for a second into a file
audio.setInput('mic', function(err) {
var chunks = [];
audio.on('data', function(data) {
chunks.push(data);
});
// Start the recording
audio.startRecording(function(err) {
// In one second
setTimeout(function() {
// Stop recording
audio.stopRecording(function(err) {
// Write the buffer to a file
fs.writeFile("micdata", Buffer.concat(chunks), function(err) {
console.log("Wrote to a file");
});
});
}, 1000);
});
});
});
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/publicdomain/zero/1.0/
/*********************************************
This Audio Module demo sets volume, then plays
an audio file out over Headphones/Line out
*********************************************/