question

joshsagarfreelance avatar image
joshsagarfreelance asked

Uploading/Downloading Music Tracks

Hi there,

I'm wondering what would be the best solution for an app that

- Allows users to upload a song they created, and then have that song be available to all other users in the app and downloadable to them.

Would file management work for this, and if it does can you do the following

- Upload a json file containing all of the currently available songs (after being moderated by ourselves).

- Unity downloads that json file and shows a list of all the songs

- User clicks a 'play sample' button and then unity downloads the sample from the cdn and plays it.

- User decides to buy that song, unity downloads the real song from the cdn.

So the json would look something like this

{
    "Songs": {
        "song1": {
            "info": {
                "title": "song 1",
                "filename": "song1.mp3",
                "samplename": "song1sample.mp3"
            }
        },
        
        "song2": {
            "info": {
                "title": "song 2",
                "filename": "song2.mp3",
                "samplename": "song2sample.mp3"
            }
        }
    }
}

If the user buys the song, can the cdn then download the mp3 by searching for the song? Or how would I then find the song that the user has bought to download it?

Thanks

Account ManagementContent
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

What you are asking is more like a UGC system which PlayFab will offer in the future (currently in private preview), however, there is no ETA on that. Now back to the question, those features you mentioned above can be done using our CDN feature, please follow this Content Delivery Network quickstart and Admin/Client/Server API references to get started. And, as I see it, players may not have direct accesses to uploading/downloading songs, all these should be done from the server-side. Players can only make requests of uploading/downloading a certain song to the back-end server where you can perform some validations such as:

  1. Is the player requesting a sample song?
  2. Does the player own this song?
  3. Is the song name the player uploads duplicated?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.