AVS Device SDK Support for Apple Music


Streaming from Apple Music isn't enabled by default. To enable Apple Music, use the following instructions.

Ubuntu / Linux / Raspberry Pi

To enable Apple Music on Unix/Linux systems

  1. Install the required dependencies with the following command.

     sudo apt install libavcodec-dev libavformat-dev libavutil-dev ffmpeg
    
  2. Add the following CMake flags to your build command.

     -DENABLE_SAMPLE_AES=ON
     -DFFMPEG_INCLUDE_DIR=<path to ffmpeg include>
     -DFFMPEG_LIB_PATH=<path to ffmpeg lib>
    
  3. Link the Apple Music account that you are using to the Alexa account that's registered to the SDK through the Apple Music Skill on the companion app.

Example CMake command for Ubuntu/Linux

cmake \
-DGSTREAMER_MEDIA_PLAYER=ON \
-DENABLE_SAMPLE_AES=ON \
-DPORTAUDIO=ON \
-DPORTAUDIO_LIB_PATH=$PORTAUDIO/lib/.libs/libportaudio.a \
-DPORTAUDIO_INCLUDE_DIR=$PORTAUDIO/include \
-DCMAKE_BUILD_TYPE=DEBUG \
-DENABLE_ALL_ENDPOINT_CONTROLLERS=ON \
-DFFMPEG_INCLUDE_DIR=/usr/include/x86_64-linux-gnu/ \
-DFFMPEG_LIB_PATH=/usr/lib/x86_64-linux-gnu

Example CMake command for Raspberry Pi

cmake \
-DGSTREAMER_MEDIA_PLAYER=ON \
-DENABLE_SAMPLE_AES=ON \
-DPORTAUDIO=ON \
-DPORTAUDIO_LIB_PATH=/usr/lib/arm-linux-gnueabihf/libportaudio.so \
-DPORTAUDIO_INCLUDE_DIR=/usr/include \
-DCMAKE_BUILD_TYPE=DEBUG \
-DENABLE_ALL_ENDPOINT_CONTROLLERS=ON \
-DFFMPEG_INCLUDE_DIR=/usr/include/arm-linux-gnueabihf / \
-DFFMPEG_LIB_PATH=/usr/lib/arm-linux-gnueabihf \
-DCURL_INCLUDE_DIR=/usr/include/arm-linux-gnueabihf \
-DCURL_LIBRARY=/usr/lib/arm-linux-gnueabihf/libcurl.so 

macOS

To enable Apple Music on macOS

  1. Install the required dependencies with the following command.

     brew install ffmpeg
    
  2. Add the following CMake flags to your build command.

     -DENABLE_SAMPLE_AES=ON
     -DFFMPEG_INCLUDE_DIR=<path to ffmpeg include>
     -DFFMPEG_LIB_PATH=<path to ffmpeg lib>
    
  3. Link the Apple Music account that you are using to the Alexa account that's registered to the SDK through the Apple Music Skill on the companion app.

Example CMake command for macOs

cmake \
-DGSTREAMER_MEDIA_PLAYER=ON \
-DENABLE_SAMPLE_AES=ON \
-DPORTAUDIO=ON \
-DPORTAUDIO_LIB_PATH=$(brew --prefix)/opt/portaudio/lib/libportaudio.dylib \
-DPORTAUDIO_INCLUDE_DIR=$(brew --prefix)/opt/portaudio/include \
-DCMAKE_BUILD_TYPE=DEBUG \ 
-DENABLE_ALL_ENDPOINT_CONTROLLERS=ON \
-DFFMPEG_INCLUDE_DIR=$(brew --prefix)/opt/ffmpeg/include/ \
-DFFMPEG_LIB_PATH=$(brew --prefix)/opt/ffmpeg/lib/ \
-DCURL_LIBRARY=$(brew --prefix)/opt/curl/lib/libcurl.dylib \
-DCURL_INCLUDE_DIR=$(brew --prefix)/opt/curl/include 

Was this page helpful?

Last updated: Apr 21, 2022