diff --git a/Playing-Audio-Files.md b/Playing-Audio-Files.md index 0e5ee47..5e8837d 100644 --- a/Playing-Audio-Files.md +++ b/Playing-Audio-Files.md @@ -15,7 +15,7 @@ Most laptop computers can easily make voice recordings. In Windows, the Sound Recorder program creates .wma files. Many free websites like [this one](https://audio.online-convert.com/convert-to-mp3) can convert your existing audio file into .wav or .mp3 format. -[

Return to Top](#introduction)

+

[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Playing Audio Files]]

## Step 2 - My Sounds @@ -27,7 +27,7 @@ This open a new Chrome tab called **My Sounds**, where you can upload and manage

[[/images/Playing-Audio-Files/0120-My_Sounds-menu.png|]]

-[

Return to Top](#introduction)

+

[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Playing Audio Files]]

## Step 3 - SoundPool Menu @@ -35,7 +35,7 @@ Leave the My Sounds tab open, and return to the first Chrome tab. Open a Blocks

[[/images/Playing-Audio-Files/0130-SoundPool-menu.png|]]

-[

Return to Top](#introduction)

+

[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Playing Audio Files]]

## Step 4 - Initialize SoundPool @@ -43,7 +43,7 @@ It's best to do this before `waitForStart`, to save time later.

[[/images/Playing-Audio-Files/0140-initialize-SoundPool.png|]]

-[

Return to Top](#introduction)

+

[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Playing Audio Files]]

## Step 5 - Preload Sound @@ -61,7 +61,7 @@ For safety and convenience, add a secondary condition to the Repeat Until loop:

[[/images/Playing-Audio-Files/0160-init-telemetry.png|]]

-[

Return to Top](#introduction)

+

[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Playing Audio Files]]

## Step 6 - Play Sound @@ -85,7 +85,7 @@ Windows Explorer gives a handy estimate of playback duration, rounded to the nea Right-click on any column heading, and choose "Length" (not "Duration"). This helps when starting to determine the exact amount of timed pause needed by a sound clip. -[

Return to Top](#introduction)

+

[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Playing Audio Files]]

## Use in Development @@ -95,7 +95,7 @@ Even simple counting values can be indicated with a number of beeps, or with rec Sounds are most practical in a test environment, without the extreme noise of a tournament. -[

Return to Top](#introduction)

+

[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Playing Audio Files]]

## SoundPool Options @@ -105,7 +105,7 @@ Review the **optional** green Blocks to adjust volume, rate and looping. Hover t Make these settings **before** playing the audio file. -[

Return to Top](#introduction)

+

[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Playing Audio Files]]

## Other Notes @@ -121,7 +121,7 @@ For spoken audio that plays only on the Driver Hub or DS phone, see this FTC Wik Special note... you may find that Android does not load or play the audio files instantly, especially the first time. It takes some practice to determine a file's response characteristics; still there can be unpredictable system-related variation. Consider pre-playing key sounds, for instant response later. -[

Return to Top](#introduction)

+

[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Playing Audio Files]]

## Longer Playbacks @@ -143,7 +143,7 @@ Some [forums](https://stackoverflow.com/questions/43060791/android-soundpool-can One FTC team wanted a theme song for autonomous. If the playing time can't be stretched enough, a last resort might be to break up the recording into **several sections** and play them in order. With great care this could be overlaid onto a completed/fine-tuned Linear OpMode autonomous. Or the autonomous could be re-written as a **state machine** in an Iterative OpMode, with the audio clips played in a **timed sequence**. Not so easy but maybe a good programming project! Learn about Blocks timers at [this FTC Wiki tutorial](https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Timers-in-FTC-Blocks). -[

Return to Top](#introduction)

+

[[Return to Top|https://github.com/FIRST-Tech-Challenge/FtcRobotController/wiki/Playing Audio Files]]

***