8000 move defaultPitch · arduino-collections/TTS@e6510e2 · GitHub
[go: up one dir, main page]

Skip to content

Commit e6510e2

Browse files
committed
move defaultPitch
1 parent 61c8b63 commit e6510e2

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

TTS.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ static char phonemes[128];
2323
static char modifier[128]; // must be same size as 'phonemes'
2424
static char g_text[128];
2525

26-
static byte defaultPitch = 7;
27-
2826
// Lookup user specified pitch changes
2927
static const byte PROGMEM PitchesP[] = { 1, 2, 4, 6, 8, 10, 13, 16 };
3028

@@ -557,16 +555,7 @@ static void play(byte duration, byte soundNumber)
557555
TTS::TTS(int pin)
558556
{
559557
::pin = pin;
560-
}
561-
562-
void TTS::setPitch(byte pitch)
563-
{
564-
defaultPitch = pitch;
565-
}
566-
567-
byte TTS::getPitch(void)
568-
{
569-
return defaultPitch;
558+
defaultPitch = 7;
570559
}
571560

572561
/*

TTS.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,15 @@ class TTS {
5151
/**
5252
* sets the pitch; higher values: lower pitch
5353
*/
54-
void setPitch(byte pitch);
54+
void setPitch(byte pitch) { defaultPitch = pitch; }
5555

5656
/**
5757
* gets the pitch
5858
*/
59-
byte getPitch(void);
59+
byte getPitch(void) { return defaultPitch; }
60+
61+
private:
62+
byte defaultPitch;
6063
};
6164

6265
#endif

0 commit comments

Comments
 (0)
0