浏览器webaudio api模拟自然声音音效导出wav声音文件代码

代码语言:html

所属分类:多媒体

代码描述:浏览器webaudio api模拟自然声音音效导出wav声音文件代码

代码标签: 浏览器 webaudio api 模拟 自然 声音 音效 导出 wav 声音 文件 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Web Audio 自然声音模拟器 & 导出器</title>
<style>
  * { margin: 0; padding: 0; box-sizing: border-box; }
  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0f1923; color: #e0e0e0;
    min-height: 100vh; display: flex; justify-content: center; align-items: center;
  }
  .container {
    background: #1a2733; border-radius: 16px; padding: 32px;
    max-width: 520px; width: 100%; box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  }
  h1 { font-size: 22px; margin-bottom: 6px; color: #fff; }
  p.subtitle { font-size: 13px; color: #8899aa; margin-bottom: 24px; }
  
  .sound-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
  .sound-btn {
    background: #253545; border: 2px solid transparent; border-radius: 10px;
    padding: 14px 12px; cursor: pointer; transition: all 0.2s; text-align: left;
  }
  .sound-btn:hover { background: #2d4055; }
  .sound-btn.active { border-color: #4fc3f7; background: #1e3a50; }
  .sound-btn .icon { font-size: 24px; margin-bottom: 4px; }
  .sound-btn .name { font-size: 14px; font-weight: 600; color: #fff; }
  .sound-btn .desc { font-size: 11px; color: #8899aa; margin-top: 2px; }

  .controls { margin-bottom: 20px; }
  .controls label { font-size: 13px; color: #8899aa; display: block; margin-bottom: 6px; }
  .controls input[type=range] {
    width: 100%; accent-color: #4fc3f7; height: 6px;
    -webkit-appe.........完整代码请登录后点击上方下载按钮下载查看

网友评论0