### Install expo-music-info-2 package Source: https://github.com/mehrabsp/expo-music-info-2/blob/main/README.md Instructions for installing the `expo-music-info-2` library using either `expo install` for Expo projects or `npm i` for general Node.js/React Native projects. ```Shell expo install expo-music-info-2 ``` ```Shell npm i --save expo-music-info-2 ``` -------------------------------- ### Example of MusicInfo.getMusicInfoAsync with options Source: https://github.com/mehrabsp/expo-music-info-2/blob/main/README.md A practical example showing how to import `MusicInfo` and use `getMusicInfoAsync` with specific options to retrieve title, artist, album, genre, and picture data from an MP3 file. The function returns a promise that resolves with the metadata. ```JavaScript import MusicInfo from 'expo-music-info'; let metadata = await MusicInfo.getMusicInfoAsync('file:///storage/emulated/0/Music/far_from_love.mp3', { title: true, artist: true, album: true, genre: true, picture: true }); ``` -------------------------------- ### MusicInfo.getMusicInfoAsync Options API Source: https://github.com/mehrabsp/expo-music-info-2/blob/main/README.md Detailed documentation for the `options` parameter of `MusicInfo.getMusicInfoAsync`. This table specifies available boolean properties, their types, default values, and descriptions for including specific ID3 tag frames in the returned metadata. ```APIDOC Options: title: Type: boolean Default: true Description: Whether to include TIT2 tag frame text data. artist: Type: boolean Default: true Description: Whether to include TPE1 tag frame text data. album: Type: boolean Default: true Description: Whether to include TALB tag frame text data. genre: Type: boolean Default: false Description: Whether to include TCON tag frame text data. picture: Type: boolean Default: false Description: Whether to include APIC tag frame data - cover picture's text description and Base64-encoded image binary data. ``` -------------------------------- ### Retrieve audio metadata using MusicInfo.getMusicInfoAsync Source: https://github.com/mehrabsp/expo-music-info-2/blob/main/README.md Demonstrates the basic function call to retrieve music information from a file URI. This function is asynchronous and takes a file URI and an optional options object. ```JavaScript MusicInfo.getMusicInfoAsync(fileUri, options); ``` -------------------------------- ### Structure of MusicInfo result object Source: https://github.com/mehrabsp/expo-music-info-2/blob/main/README.md Illustrates the typical structure of the `MusicInfo` object returned by `getMusicInfoAsync` upon successful retrieval of metadata. It includes fields like title, album, artist, and a `picture` object containing description and Base64-encoded image data. ```JavaScript MusicInfo { "title": "Far from love", "album": "Missquerada", "artist": "Missquerada", "picture": Object { "description": "", "pictureData": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEASABIAAD..." } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.