|
1 | | -# waveform-visualizer examples |
| 1 | +# waveform-visualizer - simple waveform-visualizer example |
2 | 2 |
|
3 | | -## getting started |
| 3 | +## build |
4 | 4 |
|
5 | | -### installing |
| 5 | +first, use your favorite command line tool and go into the root of this project: |
6 | 6 |
|
7 | | -* |
| 7 | +```shell |
| 8 | +cd /waveform-visualizer |
| 9 | +``` |
| 10 | + |
| 11 | +then use the follwing command in the root of this repository to build the waveform-visualizer itself: |
| 12 | + |
| 13 | +`npm run build` |
| 14 | + |
| 15 | +Note: for more instructions about the waveform-visualizer itself check out the [waveform-visualizer README](../../README.md) |
| 16 | + |
| 17 | +then, build the example (server & client) itself: |
| 18 | + |
| 19 | +go into the example folder: |
| 20 | + |
| 21 | +```shell |
| 22 | +cd /waveform-visualizer/examples/simple-waveform |
| 23 | +``` |
| 24 | + |
| 25 | +install the latest nodejs (if you haven't already) [nodejs](https://nodejs.org) |
| 26 | + |
| 27 | +update npm to latest version |
| 28 | + |
| 29 | +`npm install npm@latest -g` |
| 30 | + |
| 31 | +install the server dependencies |
| 32 | + |
| 33 | +### client |
| 34 | + |
| 35 | +#### go into the client folder |
| 36 | + |
| 37 | +```shell |
| 38 | +cd client |
| 39 | +``` |
| 40 | + |
| 41 | +#### install the client dependencies |
| 42 | + |
| 43 | +```shell |
| 44 | +npm i |
| 45 | +``` |
| 46 | + |
| 47 | +### build the client |
| 48 | + |
| 49 | +```shell |
| 50 | +npm run build |
| 51 | +``` |
| 52 | + |
| 53 | +### server |
| 54 | + |
| 55 | +#### go into the server folder |
| 56 | + |
| 57 | +```shell |
| 58 | +cd server |
| 59 | +``` |
| 60 | + |
| 61 | +#### install the server dependencies |
| 62 | + |
| 63 | +```shell |
| 64 | +npm i |
| 65 | +``` |
| 66 | + |
| 67 | +#### build the server |
| 68 | + |
| 69 | +```shell |
| 70 | +npm run build |
| 71 | +``` |
| 72 | + |
| 73 | +#### start the server |
| 74 | + |
| 75 | +start the server |
| 76 | + |
| 77 | +`npm run start` |
| 78 | + |
| 79 | +## usage |
| 80 | + |
| 81 | +open the project in your browser: |
| 82 | + |
| 83 | +`http://127.0.0.1:35000/` |
| 84 | + |
| 85 | +* click the play button to launch the song |
| 86 | +* the stop button (you guessed it) stops the song from playing |
| 87 | +* click into the waveform to change the song position |
| 88 | +* you can adjust the volume using the volume bar at the bottom |
| 89 | + |
| 90 | +check out the /client source code, especially /client/library/visualizer.ts to get an idea of how you can use the visualizer in your own projects |
| 91 | + |
| 92 | +* the audio player I used for the demo, is another of my projects and is available on npm too: https://www.npmjs.com/package/web-audio-api-player |
| 93 | +* the waveform data for the song was generated using another of my projects, the "waveform data generator" and the source code to build create your own data can be found on github: https://github.com/chrisweb/waveform-data-generator |
| 94 | + |
| 95 | +## linting |
| 96 | + |
| 97 | +the linting is now done via the npm run lint command of the main project |
0 commit comments