Audio App: No Title for my mp3 File.

Hey guys, I've been working on an Audio Content Provider app.  It's able to download the mp3 files, and can successfully play them back.  However, I don't manage the mp3 files that are downloaded, and apparently the files don't have the "title" metadata field, and thus the title is blank on the watch. The user can't tell the name of the audio file.  Does anyone know how I can get the title to display on the watch? I've tried to see if I could use setMetadata() to set the "title" value, but I haven't gotten it to work yet.  Does anyone have ideas on this?

Thanks,

SirLancelot

  • It seems like the getMetadata() function might be able to be used with the setMetadata() function... Does anyone know how to do this? When I print Mysong.getMetadata(), I get Obj: 171.  Does anyone know how I can modify this object so I can pass it through the setMetadata() function with the correct title?  

  • Okay, I got it! Here's my solution.  Side note for anyone else who isn't getting title parameters back with their audio: I put this code in 

    onSongDownloaded(responseCode, data, context) in SyncDelegate.  One of the entries I put in my context dictionary was the correct audio title, and I just grabbed it and set MetadataObj.title equal to it.  I hope this helps someone!

    var MetadataObj = Media.getCachedContentObj(new Media.ContentRef(YOUR_ID_HERE, Media.CONTENT_TYPE_AUDIO)).getMetadata();
    MetadataObj.title = "My Custom Title";
    Media.getCachedContentObj(new Media.ContentRef(YOUR_ID_HERE, Media.CONTENT_TYPE_AUDIO)).setMetadata(MetadataObj);