Skip to content

Commit

Permalink
Safer
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-matt-hillsdon committed Aug 27, 2024
1 parent 73c035e commit abe1bfb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/board/audio/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,6 @@ export class BoardAudio {
this.stopRecording();
}
};

this.sensitivityNode!.connect(recorder);
recorder.connect(this.context!.destination);

this.stopActiveRecording = () => {
recorder.disconnect();
this.sensitivityNode!.disconnect();
Expand All @@ -254,6 +250,9 @@ export class BoardAudio {
this.microphoneEl.style.display = "none";
this.stopActiveRecording = undefined;
};

this.sensitivityNode!.connect(recorder);
recorder.connect(this.context!.destination);
}

boardStopped() {
Expand Down
3 changes: 2 additions & 1 deletion src/examples/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
rate_index = 0

print("Recording...")
my_track = microphone.record(3000)
my_recording = microphone.record(3000)
my_track = my_recording.track()
print("Button A to play")
while True:
if button_a.was_pressed():
Expand Down

0 comments on commit abe1bfb

Please sign in to comment.