浏览代码

Add pitch control for looping sources; adjust row sizing

master
Fen Dweller 4 年前
父节点
当前提交
82a3cf9cec
共有 2 个文件被更改,包括 7 次插入2 次删除
  1. +1
    -1
      src/components/SoundscapeComp.vue
  2. +6
    -1
      src/sources/LoopingSource.ts

+ 1
- 1
src/components/SoundscapeComp.vue 查看文件

@@ -71,7 +71,7 @@ export default class SoundscapeComp extends Vue {
height: 100%;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
grid-auto-rows: 200px;
grid-auto-rows: auto-fit;
grid-gap: 20px;
background: #222;
border-radius: 30px;


+ 6
- 1
src/sources/LoopingSource.ts 查看文件

@@ -1,11 +1,15 @@
import { Source } from "./Source";
import { context } from "../audio";
import { context, exposedNumber } from "../audio";

export class LoopingSource extends Source {
kind = "Looping";
private source!: AudioBufferSourceNode;
private started = false;
private running = false;

@exposedNumber("Pitch", 0.25, 4)
public pitch = 1;

constructor(name: string) {
super(name);
}
@@ -31,5 +35,6 @@ export class LoopingSource extends Source {
this.source.start();
this.running = true;
}
this.source.playbackRate.value = this.pitch;
}
}

正在加载...
取消
保存