Sound Events – Story Tellers iOS Starter Kit Documentation

Sound and Text-to-Speech Events

Story Tellers iOS Starter Kit 2 Documentation

  • PlayBackgroundSound – the value will be the sound file minus extension (the code will add .mp3 to the end).

Sound events in Sprite Kit

  • StopBackgroundSound – the value will be the sound file minus extension  (the code will add .mp3 to the end).
  • PlayOrStopBackgroundSound – the value will be the sound file minus extension (the code will add .mp3 to the end).
  • PlayOrStopNarrationSound – the value will be the sound file minus extension (the code will add .mp3 to the end).
  • PlayNarrationSound – the value will be the sound file minus extension (the code will add .mp3 to the end).
  • StopNarrationSound – the value will be the sound file minus extension (the code will add .mp3 to the end).

Note: you can choose whether or not narration and background sounds stop when the page transitions using Page Settings properties.

  • PlaySound –  the value will be the sound file PLUS extension (the source can be any supported sound format).

Sound events in Sprite Kit

  • PlaySoundFromPool – enter the name of a pool array containing an unlimited number of sound files. For example…

Play Random Sounds with Sprite Kit

  • PlaySoundFromPreference –  enter the name of a saved value which notes the sound file. For example…

Play sound file in SpriteKit

As some point prior to calling PlaySoundFromPreference, the app should set a value for PreferredSound (or whatever you named this preference).

saving sound file preference in iOS9 starter kit 2

 

 


 

To find out more on sound properties you can set on a per-page basis, go here  (for example, whether or not the background sound continues or restarts on each page).

Text-to-Speech Events

You can watch a video on these cool new features…

 

  • Speak – the value will be any text you want spoken.

text to speech options in the iOS Childrens Book Starter Kit 1

  • SpeakLabel –  the name of the SKLabelNode you want to have spoken

text to speech options in the iOS Childrens Book Starter Kit 2

text to speech options in the iOS Childrens Book Starter Kit 3

  • SpeakPreference – the value can be ANY saved value.

text to speech options in the iOS Childrens Book Starter Kit 4

 

Changing the Speech Voice 

  • SpeechRate –  a decimal number value, default is 0.38. This property can be an event or set in the page’s Settings dictionary
  • SpeechVolume – a decimal number value, default is 1.  This property can be an event or set in the page’s Settings dictionary
  • SpeechPitch – a decimal number value, default is 1.70.  This property can be an event or set in the page’s Settings dictionary
  • SpeechVoice – a voice code or country name for a new voice.  This property can be an event or set in the page’s Settings dictionary
  • OutputVoiceCodes – An event property which will output all the country name and voice codes.
  • AllowRunOnSpeech – For the page’s Settings dictionary.  Set YES and events that call text to speak will not interrupt the current speaking. So for example,  calling a Speak event back to back will run the speech one after the other.

text to speech options in the iOS Childrens Book Starter Kit 5

If you stumbled onto this article, it is part of our documentation for the Story Tellers iOS Starter Kit 2. The kit enables you to make children’s book apps and games without writing any code! But it is Swift 2 based and compatible with iOS9 (or higher) and Xcode 7 (or higher), so kit buyers can even extend the functionality to fit their needs further. Some of what we cover in the kit documentation may apply to Xcode in general, so this article could be worth a read even if you aren’t a user. You can purchase Lifetime Updates the kit here, or subscribe Yearly to CartoonSmart and get the latest version, plus access to all of our other kits / tutorials.

We’ve also created an iBook to document the very latest properties in the kit, so be sure to download that as well.