![]() You can use Online-convert to achieve WAV files with different formats from any source audio file. The WAV file can have any sampling rate and can have any number of channels. It is important that the WAV file be PCM signed 16-bit little endian, or else it will not play becaues USBAudio does not support any other WAV formats. The example below uses a public domain WAV file called "Bach-minuet-in-g.wav" (attached below for download) that is inside a "songs" directory on the SD card. For example, in the example below, line 10 sets up SPI for the SDBlockDevice for the NXP K64F Mbed board. Make sure the SPI pins for the SDBlockDevice object are updated and correct for your board. The following steps demonstrate the setup and use of the Mbed WAV audio player:Īdd the sd-driver and AudioPlayer libraries to the new Mbed project directory:Ĭopy and paste the example code into main.cpp. Please install Mbed CLI to complete the tutorial. SD card shield (if the board does not already have an SD card port).Lastly, it uses the AudioPlayer and WaveAudioStream classes of the AudioPlayer library to access the audio data from the WAV file on the SD card. It uses the SDBlockDevice and FATFileSystem classes of the sd-driver library, so you can store the WAV files on an SD card and the Mbed board can access them. This tutorial uses the USBAudio class of the USB library to send audio data from the Mbed board to the host PC. This tutorial uses several Mbed libraries: ![]() The steps below describe this in more detail.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |