User:Zuhui/Weekly notes/code for audio api, 0923
< User:Zuhui | Weekly notes
Revision as of 11:33, 5 October 2024 by Zuhui (talk | contribs) (Created page with "===Michael's code for reference=== <code> <body> <button class=“sb-start-audio">start</button> <audio src="software_art_repository.ogg" controls style="width: 100%" class=“sb-source” id="voice" data-connect=“voice-volume"></audio> Vol: <input type="range" id="voice-volume" class="sb-gain" data-connect="voice-panner" min="0" max="50" value="1" step="0.01" /><br> Pan: <input type="range" id="voice-panner" class="sb-panner" data-connect="voice-chorus" min=...")
Michael's code for reference
<body>
<button class=“sb-start-audio">start</button>
<audio src="software_art_repository.ogg" controls style="width: 100%" class=“sb-source” id="voice" data-connect=“voice-volume"></audio>
Vol: <input type="range" id="voice-volume" class="sb-gain" data-connect="voice-panner" min="0" max="50" value="1" step="0.01" />
Pan: <input type="range" id="voice-panner" class="sb-panner" data-connect="voice-chorus" min="-1" max="1" value="0" step="0.01" />
Chorus
Enabled: <input type="checkbox" id="voice-chorus" data-connect="voice-delay" class="sb-tuna" data-tuna-classname="Chorus" />
Rate: <input type="range" id="voice-chorus" class="sb-tuna-param" data-param="rate" data-for="voice-chorus" min="0.01" max="8" value="0.01" step="0.01" />
Feedback: <input type="range" class="sb-tuna-param" data-param="feedback" data-for="voice-chorus" min="0" max="1" value="0.4" step="0.005" />
Depth: <input type="range" class="sb-tuna-param" data-param="depth" data-for="voice-chorus" min="0" max="1" value="0.7" step="0.005" />
Delay: <input type="range" class="sb-tuna-param" data-param="delay" data-for="voice-chorus" min="0" max="1" value="0.0045" step="0.0005" />
Delay
Enabled: <input type="checkbox" id="voice-delay" class="sb-tuna" data-tuna-classname="Delay" data-connect=“voice-phaser"/>
DelayTime: <input type="range" class="sb-tuna-param" data-param="delayTime" data-for="voice-delay" min="1" max="10000" value="1000" step=“1"/>
Feedback: <input type="range" class="sb-tuna-param" data-param="feedback" data-for="voice-delay" min="0" max="1" value="0.45" step="0.005" />
wetLevel: <input type="range" class="sb-tuna-param" data-param="wetLevel" data-for="voice-delay" min="0" max="1" value="0.5" step="0.005" />
dryLevel: <input type="range" class="sb-tuna-param" data-param="dryLevel" data-for="voice-delay" min="0" max="1" value="1" step="0.005" />
Cutoff: <input type="range" class="sb-tuna-param" data-param="cutoff" data-for="voice-delay" min="20" max="22050" value="20000" step="10" />
Phaser
enabled: <input type="checkbox" id="voice-phaser" class="sb-tuna" data-tuna-classname="Phaser" data-connect="voice-compressor" />
rate: <input type="range" class="sb-tuna-param" data-param="rate" data-for="voice-phaser" min="0.01" max="8" value="0.1" step="0.01" />
depth: <input type="range" class="sb-tuna-param" data-param="depth" data-for="voice-phaser" min="0" max="1" value="0.6" step="0.005" />
feedback: <input type="range" class="sb-tuna-param" data-param="feedback" data-for="voice-phaser" min="0" max="1" value="0.7" step="0.005" />
stereoPhase: <input type="range" class="sb-tuna-param" data-param="stereoPhase" data-for="voice-phaser" min="0" max="180" value="40 step="1" />
compressor
enabled: <input type="checkbox" id="voice-compressor" class="sb-tuna" data-tuna-classname="Compressor" data-connect="destination" />
threshold: <input type="range" class="sb-tuna-param" data-param="threshold" data-for="voice-compressor" min="-100" max="0" value="-20" step="1" />
makeupGain: <input type="range" class="sb-tuna-param" data-param="makeupGain" data-for="voice-compressor" min="0" max="10" value="1" step="1" />
attack: <input type="range" class="sb-tuna-param" data-param="attack" data-for="voice-compressor" min="0" max="1000" value="1" step="1" />
release: <input type="range" class="sb-tuna-param" data-param="release" data-for="voice-compressor" min="0" max="3000" value="250" step="1" />
ratio: <input type="range" class="sb-tuna-param" data-param="ratio" data-for="voice-compressor" min="1" max="20" value="4" step="1" />
knee: <input type="range" class="sb-tuna-param" data-param="ratio" data-for="voice-compressor" min="0" max="40" value="5" step="1" />
<audio src=“오디오파일" controls style="width: 100%"></audio>
so using <a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API">Web Audio API</a>, and <a href="https://github.com/Theodeus/tuna">tuna</a> + <a href="https://github.com/Theodeus/tuna/wiki/Getting-started">the tuna wiki</a>,
</body>
<script src=“tuna.js”></script>
<script src=“soundboard.js”></script>
</html>