File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
examples/examples-audiokit/streams-audiokit-ram-audiokit Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -17,25 +17,19 @@ uint16_t sample_rate = 16000;
17
17
uint8_t channels = 1 ; // The stream will have 2 channels
18
18
AudioKitStream kit;
19
19
MemoryManager memory (500 ); // Activate SPI RAM for objects > 500 bytes
20
- DynamicMemoryStream recording (true ); // Audio Stored on heap (PSRAM)
20
+ DynamicMemoryStream recording (true ); // Audio stored on heap
21
21
StreamCopy copier; // copies data
22
- bool is_recording = false ; // flag to make sure that close is only executed one
23
- uint64_t end_time; // trigger to call endRecord
24
22
25
23
26
24
void record_start (bool pinStatus, int pin, void * ref){
27
25
Serial.println (" Recording..." );
28
26
recording.begin ();
29
27
copier.begin (recording, kit);
30
- is_recording = true ;
31
28
}
32
29
33
30
void record_end (bool pinStatus, int pin, void * ref){
34
- if (recording == true ){
35
- Serial.println (" Playing..." );
36
- is_recording = false ;
37
- copier.begin (kit, recording); // start playback
38
- }
31
+ Serial.println (" Playing..." );
32
+ copier.begin (kit, recording); // start playback
39
33
}
40
34
41
35
void setup (){
You can’t perform that action at this time.
0 commit comments