Version 7 (modified by 2 months ago) ( diff ) | ,
---|
Audio
The 825 Gen2 has an audio line out port. Powered speakers may be plugged into this port to allow for high quality stereo audio output. The audio output is independent from the beeper.
The command line utility aplay may be used to play wav files to the audio output, for example: (For this example audio files are placed on a flash drive in directory wav_files auto mounted as /run/media/sda1)
card825gen2:~$ aplay /run/media/sda1/wav_files/BOUNCEIN.WAV Playing WAVE '/run/media/sda1/wav_files/BOUNCEIN.WAV' : Signed 16 bit Little Endian, Rate 22050 Hz, Mono card825gen2:~$ aplay /run/media/sda1/wav_files/BOING.WAV Playing WAVE '/run/media/sda1/wav_files/BOING.WAV' : Signed 16 bit Little Endian, Rate 22025 Hz, Mono card825gen2:~$ aplay /run/media/sda1/wav_files/BOUNCE.WAV Playing WAVE '/run/media/sda1/wav_files/BOUNCE.WAV' : Signed 16 bit Little Endian, Rate 22025 Hz, Mono card825gen2:~$ aplay /run/media/sda1/wav_files/HAPPY.WAV Playing WAVE '/run/media/sda1/wav_files/HAPPY.WAV' : Signed 16 bit Little Endian, Rate 22050 Hz, Mono card825gen2:~$ aplay /run/media/sda1/wav_files/MELT.WAV Playing WAVE '/run/media/sda1/wav_files/MELT.WAV' : Signed 16 bit Little Endian, Rate 22050 Hz, Mono
Gstreamer may be used to play an mp3 audio file:
card825gen2:~$ gst-launch-1.0 playbin uri=file:///run/media/Data-sda1/sample-12s.mp3
App may be written to output audio by using system calls to perform commands such as above. However, it would be better to use gstreamer library calls in the app. An example of this will be added to this page at a later date.