Wiki

This version (04 Oct 2023 21:07) was approved by Rebecca Butler.The Previously approved version (19 Sep 2023 19:44) is available.Diff

Sharc Audio Module - WAV Audio Example

This section will take you through a few examples to set up and run audio, including using the shell terminal program to interface with the application and stream audio via a .wav file.

Hardware Setup

Follow the instructions below to set up your specific hardware variant.

ADZS-SC589-MINI

1. Power on your SAM board and plug in the 12V Power Supply to the 12V connector. If the board is properly powered, the green LED9/PWR will light up.
2. Plug the USB Micro Type B side to the SAM board USB connector and the USB Type A side to a USB connection on the PC.
3. Connect a Portable speaker or headphones to the LINE OUT connector on the SAM (ensure the speaker is turned on!).
4. Proceed to the software setup instructions (common for all hardware variants) NA

ADZS-SC584-EZLITE

1. Power on your board and plug in the 12V Power Supply to the 12V connector. If the board is properly powered, the green PWR LED will light up.
2. Plug the USB Micro Type B side to the board USB OTG connector and the USB Type A side to a USB connection on the PC.
3. Connect the Portable speaker to the HEADPHONES connector on the board (ensure the speaker is turned on!).
4. Proceed to the software setup instructions (common for all hardware variants) NA

Software Setup

Follow the instructions below to set up the software.

Serial Terminal Setup

This tutorial uses TeraTerm as the serial interface to your hardware.

Follow the instructions below to set up a connection to your hardware:

1. Open TeraTerm and connect to a new Serial Session, connecting to the Port labeled SC5xx Communications Port.
2. After connection, navigate to the Serial Port settings under Setup and change the Port settings to the following:

Speed/Baud - 115200
Data Bits - 8-bit
Stop Bits - 1
Parity - None
Flow Control - None
3. With a successful connection, after reset, the terminal will display SAM Audio Starter with the version. Type help to list the available shell commands.

Transferring a WAV File

This section will instruct the user how to transfer a WAV file to the SHARC Audio platform over XMODEM. The example will use TeraTerm to send the WAV file.

1. Ensure the file system on your device is formatted and mounted correctly. To do this, you can run format in the shell to format all drives, then reset the device to mount each filesystem.
2. Call recv <filename.wav> to prepare the SHARC platform to receive a WAV audio file over an XMODEM connection.
3. In TeraTerm, select File→Transfer→XMODEM→Send… and select your .wav file from the PC's filesystem. Ensure the test .wav file uses a sample rate of 48000 Hz.
4. Check that you have transferred the file by checking the result of the recv command, and then call ls to observe the new file in your storage media.

Audio Connection Setup

This setup will allow audio to pass from input to output through your hardware by using both an analog input source and an analog output source. This setup allows us to play audio via an Audio Jack from a phone and output to a mini portable speaker.

1. In the shell terminal, type help route. The shell will display the usage for the route command.
2. In the shell terminal, type route. The shell will display the current audio routing table.
3. In the shell terminal, type route 0 wav 0 codec 0 2 20 to add to route table index 0 the audio routing of WAV file to codec output with 2 channels and an attenuation of 20dB. Type route again to ensure that table was updated properly.
4. In the shell terminal, type wav src on <filename.wav> 2 16 to enable the wav file audio source stream with 2 channels at 16 bits.
5. You should now be able to hear the audio from the input device coming out of the speaker connected to LINE OUT or HEADPHONES. NA

Having trouble? Check out our list of common issues!

Navigation - Advanced Audio Projects

resources/tools-software/sharc-audio-module/advanced-audio-projects/examples-wav-audio.txt · Last modified: 04 Oct 2023 21:07 by Rebecca Butler