How to add Audio to your NFTs
This page explains how you can add audio files to your NFTs.
In this guide, we will look into how you can add an audio or multiple audio files to your NFTs. Note that adding the audio will happen during the creation of the token-type (NFT template).
You need to have the URL of the audio address that you wish to add. When you still need to upload your media, then learn how to store your media/images on Venly Servers.
Prerequisites
- You already have an NFT collection (contract) created using the NFT-API. Click here to view the getting started guide if you haven't.
- Contract
ID
(Can be found in the response body of the create contract endpoint)
Request Endpoint: reference
POST /api/minter/contracts/{contractId}/token-types
{contractId}
: This is the contract ID
which can be found in the response body of the create contract endpoint.
Example Request
We will use the create token-type endpoint and within the request body, we will specify the animationUrls
array.
POST /api/minter/contracts/57584/token-types
Request Body
- At the very end, in the
animationUrls
array, we have defined the object withtype: audio
and itsvalue
(The URL of the audio address).- You can add multiple objects within the
animationUrls
array with images, videos, and even audio.- Click here to read more about
animationUrls
.
{
"name" : "NFT with audio",
"description" : "This NFT has an audio",
"image": "https://static.scientificamerican.com/sciam/cache/file/C91AC5AA-1F28-41E7-8E40EC59E66937D8_source.jpg?w=590&h=800&2113BA5E-A58F-4A28-ABDD0BE5C759F5B6",
"externalUrl" : "www.venly.io",
"animationUrls" : [
{
"type": "audio",
"value" : "https://storage-staging.venly.io/applications/a3079f3a-934c-4716-8d9a-195a0f3f5abb/brain-damage-148577.mp3"
}
]
}
Response Body
The token-type was created successfully with an audio included.
{
"id": 331,
"confirmed": false,
"status": "SUCCEEDED",
"name": "NFT with audio",
"description": "This NFT has an audio",
"fungible": false,
"burnable": false,
"externalUrl": "www.venly.io",
"image": "https://static.scientificamerican.com/sciam/cache/file/C91AC5AA-1F28-41E7-8E40EC59E66937D8_source.jpg?w=590&h=800&2113BA5E-A58F-4A28-ABDD0BE5C759F5B6",
"imageThumbnail": "https://static.scientificamerican.com/sciam/cache/file/C91AC5AA-1F28-41E7-8E40EC59E66937D8_source.jpg?w=590&h=800&2113BA5E-A58F-4A28-ABDD0BE5C759F5B6",
"imagePreview": "https://static.scientificamerican.com/sciam/cache/file/C91AC5AA-1F28-41E7-8E40EC59E66937D8_source.jpg?w=590&h=800&2113BA5E-A58F-4A28-ABDD0BE5C759F5B6",
"currentSupply": 0,
"pendingSupply": 0,
"animationUrls": [
{
"type": "audio",
"value": "https://storage-staging.venly.io/applications/a3079f3a-934c-4716-8d9a-195a0f3f5abb/brain-damage-148577.mp3"
}
],
"attributes": [],
"transactionHash": "0xe171605b345c9538f7402e57327961c046a41b6172fccbbd0f87a66987db5f67",
"storage": {
"type": "cloud",
"location": "https://metadata-staging.arkane.network/metadata/contracts/57584/tokens/{id}"
}
}
Audio NFT Preview
Here is how the minted NFT will look like with an audio file added. Please note that each platform might have a different way of visualising the audio file to the user.
Updated 10 months ago