Example overrides for 'music' api docs (#353)

* Example overrides for 'music' api docs

* Drop 'music' into card page
This commit is contained in:
Galen Nickel 2018-02-27 17:15:26 -08:00 committed by Peli de Halleux
parent 6d07d5bd23
commit ab3c4c5267
4 changed files with 33 additions and 0 deletions

View File

@ -1,6 +1,7 @@
# Reference # Reference
```namespaces ```namespaces
music.playSoundEffect(sounds.animalsCatPurr);
sensors.color(null); sensors.color(null);
motors.stopAll(); motors.stopAll();
brick.showMood(moods.sleeping); brick.showMood(moods.sleeping);
@ -18,5 +19,6 @@ control.runInParallel(function(){});
[brick](/reference/brick), [brick](/reference/brick),
[sensors](/reference/sensors), [sensors](/reference/sensors),
[motors](/reference/motors), [motors](/reference/motors),
[music](/reference/music),
[control](/reference/control), [control](/reference/control),
[console](/reference/console) [console](/reference/console)

View File

@ -0,0 +1,11 @@
# @extends
## Example #example
This program checks the speed from the large `A` motor and uses the speed to adjust a tone it rings.
```blocks
loops.forever(function () {
music.ringTone(motors.largeA.speed() * 100)
})
```

View File

@ -0,0 +1,10 @@
# @extends
## Example #example
Play a tyrannosaurus roar at half volume.
```blocks
music.setVolume(50)
music.playSoundEffect(sounds.animalsTRexRoar)
```

View File

@ -0,0 +1,10 @@
# @extends
## Example #example
Play a sound effect but stop it right away.
```blocks
music.playSoundEffect(sounds.expressionsCrying)
music.stopAllSounds()
```