Skip to content

Commit ce44dd4

Browse files
codygratnertherewasaguy
authored andcommitted
Used sampleRate from AudioContext for saving rather than hardcoded 44100 (#342)
1 parent ac13cca commit ce44dd4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/helpers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ define(function (require) {
259259
view.setUint16(20, 1, true);
260260
// stereo (2 channels)
261261
view.setUint16(22, 2, true);
262-
view.setUint32(24, 44100, true);
263-
view.setUint32(28, 44100 * 4, true);
262+
view.setUint32(24, p5sound.audiocontext.sampleRate, true);
263+
view.setUint32(28, p5sound.audiocontext.sampleRate * 4, true);
264264
view.setUint16(32, 4, true);
265265
view.setUint16(34, 16, true);
266266
// data sub-chunk

0 commit comments

Comments
 (0)