|
| 1 | +# Audio Streaming using VS1053 Audio Codec |
| 2 | + |
| 3 | +The goal of this project is to show how to interface with a VS1053 Audio Codec connected using SPI, and streaming NPR. |
| 4 | + |
| 5 | +## Contents |
| 6 | + |
| 7 | +| File/folder | Description | |
| 8 | +|-------------|-------------| |
| 9 | +| `src\` | Azure Sphere Sample App source code | |
| 10 | +| `src\HardwareDefinitions` | Hardware definition files for the Seeed RDB and Avnet Starter Kit | |
| 11 | +| `src\VS1053` | Source for VS1053 hardware | |
| 12 | +| `README.md` | This README file. | |
| 13 | +| `LICENSE.txt` | The license for the project. | |
| 14 | + |
| 15 | +## Prerequisites & Setup |
| 16 | + |
| 17 | +- An Azure Sphere-based device with development features (see [Get started with Azure Sphere](https://azure.microsoft.com/en-us/services/azure-sphere/get-started/) for more information). |
| 18 | +- Setup a development environment for Azure Sphere (see [Quickstarts to set up your Azure Sphere device](https://docs.microsoft.com/en-us/azure-sphere/install/overview) for more information). |
| 19 | + |
| 20 | +Note that the Azure Sphere High Level application is configured for the 21.04 SDK release. |
| 21 | + |
| 22 | +## How to use |
| 23 | + |
| 24 | +The project supports the Seeed RDB with an [Adafruit VS1053](https://www.adafruit.com/product/1381) board. |
| 25 | + |
| 26 | +Here's the pinout used in the project the Seeed RDB pinout diagram is [here](https://docs.microsoft.com/en-us/azure-sphere/hardware/mt3620-user-guide)) |
| 27 | + |
| 28 | +| Adafruit VS1053 Pin | Seeed MT3620 RDB Pin | Hardware Definition Mapping | |
| 29 | +|-------------|-------------|-------------| |
| 30 | +| VCC | Header 3, Pin 3 | NA | |
| 31 | +| GND | Header 3, Pin 2 | NA | |
| 32 | +| DREQ | Header 2, Pin 6 | VS1053_DREQ | |
| 33 | +| MISO | Header 4, Pin 5 | VS1053_SPI ISU1 | |
| 34 | +| MOSI | Header 4, Pin 11 | VS1053_SPI ISU1 | |
| 35 | +| SCLK | Header 4, Pin 7 | VS1053_SPI ISU1 | |
| 36 | +| RST | Header 2, Pin 14 | VS1053_RST | |
| 37 | +| CS | Header 1, Pin 3 | VS1053_CS | |
| 38 | +| xDCS | Header 2, Pin 12 | VS1053_DCS | |
| 39 | +| AGND | Audio Jack GND | NA | |
| 40 | +| ROUT | Audio Jack Right | NA | |
| 41 | +| LOUT | Audio Jack Left | NA | |
| 42 | + |
| 43 | +The VS1053 project code exposes four functions: |
| 44 | + |
| 45 | +* **VS1053_Init** to initialize the hardware |
| 46 | +* **VS1053_Cleanup** to cleanup SPI and GPIO resources |
| 47 | +* **VS1053_SetVolume** to set the volume level (0 is off, 30 is max) |
| 48 | +* **VS1053_PlayByte** to play audio data |
| 49 | + |
| 50 | +The project is configured to play an embedded resource audio file, and also supports internet radio streaming. To enable the internet radio stream uncomment the **add_compile_definitions** line in the following block in the CMakeLists.txt file. |
| 51 | + |
| 52 | +```cmake |
| 53 | +# ENABLE NPR INTERNET RADIO STREAM ########################################################################################## |
| 54 | +# |
| 55 | +# add_compile_definitions(ENABLE_RADIO_STREAMING) |
| 56 | +# |
| 57 | +################################################################################################################### |
| 58 | +
|
| 59 | +``` |
| 60 | + |
| 61 | +## Project expectations |
| 62 | + |
| 63 | +* The code is not official, maintained, or production-ready. |
| 64 | + |
| 65 | +### Expected support for the code |
| 66 | + |
| 67 | +This code is not formally maintained, but we will make a best effort to respond to/address any issues you encounter. |
| 68 | + |
| 69 | +### How to report an issue |
| 70 | + |
| 71 | +If you run into an issue with this code, please open a GitHub issue against this repo. |
| 72 | + |
| 73 | +## Contributing |
| 74 | + |
| 75 | +This project welcomes contributions and suggestions. Most contributions require you to |
| 76 | +agree to a Contributor License Agreement (CLA) declaring that you have the right to, |
| 77 | +and actually do, grant us the rights to use your contribution. For details, visit |
| 78 | +https://cla.microsoft.com. |
| 79 | + |
| 80 | +When you submit a pull request, a CLA-bot will automatically determine whether you need |
| 81 | +to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the |
| 82 | +instructions provided by the bot. You will only need to do this once across all repositories using our CLA. |
| 83 | + |
| 84 | +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). |
| 85 | +For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) |
| 86 | +or contact [[email protected]](mailto:[email protected]) with any additional questions or comments. |
| 87 | + |
| 88 | +## License |
| 89 | + |
| 90 | +See [LICENSE.txt](./LICENCE.txt) |
0 commit comments