This will give you your file name
final String[] separated = url.split("/");
final String myFile = separated[separated.length - 1];
It will split the url using the / character and you take the last element in the returned array.
Arrays are 0 based, so the last element is the one located at the vector's length - 1.
Put the above code just before this line: if (url.endsWith(".m4a")) {
, where you want to get your file name.
Then, use it so:
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, myFile);