Merge pull request #71 from bykoianko/sound-notification-fix

Sound notification fix
This commit is contained in:
Vlad Mihaylenko 2015-09-30 11:52:51 +03:00
commit b87760162e
2 changed files with 5 additions and 4 deletions

View file

@ -20,8 +20,9 @@ extern NSString * const kMwmTextToSpeechDisable = @"MWMTEXTTOSPEECH_DISABLE";
self = [super init];
if (self)
{
// iOS has an issue with speechRate. AVSpeechUtteranceDefaultSpeechRate does not work correctly. It's a work around.
self.speechRate = isIOSVersionLessThan(@"7.1.1") ? 0.3 : 0.15;
// Before 9.0 version iOS has an issue with speechRate. AVSpeechUtteranceDefaultSpeechRate does not work correctly.
// It's a work around for iOS 7.x and 8.x.
self.speechRate = isIOSVersionLessThan(@"7.1.1") ? 0.3 : (isIOSVersionLessThan(@"9.0.0") ? 0.15 : AVSpeechUtteranceDefaultSpeechRate);
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(enable)

View file

@ -124,13 +124,13 @@ void TurnsSound::SetLengthUnits(LengthUnits units)
ASSERT(false, ());
return;
case LengthUnits::Meters:
m_settings = Settings(20 /* notificationTimeSeconds */, 200 /* minNotificationDistanceUnits */,
m_settings = Settings(30 /* notificationTimeSeconds */, 200 /* minNotificationDistanceUnits */,
2000 /* maxNotificationDistanceUnits */,
GetSoundedDistMeters() /* soundedDistancesUnits */,
LengthUnits::Meters /* lengthUnits */);
return;
case LengthUnits::Feet:
m_settings = Settings(20 /* notificationTimeSeconds */, 500 /* minNotificationDistanceUnits */,
m_settings = Settings(30 /* notificationTimeSeconds */, 500 /* minNotificationDistanceUnits */,
5000 /* maxNotificationDistanceUnits */,
GetSoundedDistFeet() /* soundedDistancesUnits */,
LengthUnits::Feet /* lengthUnits */);