I'm trying to set up .ogg audio file streaming with unity and encountered the following problem; the download url returned by GameSparksApi.getDownloadableRequest is something like this (some id's scrambled):
The url parameters confuse UnityEngine.WWW:GetAudioClip so that it fails to detect audio format:
Unable to determine the audio type from the URL (<see above>) . Please specify the type.
UnityEngine.WWW:GetAudioClip(Boolean, Boolean)
Any ideas how to resolve this? Would it be possible to embed the url parameters with slashes, eg. http://www.domain.com/param1/param2/param3/filename.ogg? This is hardly worth the trouble for this particular case but this same problem could emerge elsewhere as well. Ideally this should be fixed in unity so that it would omit the url parameters but you can't expect them to do anything about it.
Best Answer
T
Tech Support
said
over 8 years ago
Hi Jussi
Thanks for the code, it seem we had a missing crossdomain.xml on the blob storage that is required for you to use the WWW class in the unity editor.
You code is now working for me, and you'll not have the issue again.
I've just looked through the source for the WWW class, and GetAudioClip is overloaded. There is a version with 3 parameters where you can pass in the type of the audio as AudioType.OGGVORBIS.
If this doesn't work for you, could you share some code?
Thanks
Gabriel
J
Jussi Härkönen
said
over 8 years ago
Oops didn't notice that overload - thanks for pointing this out. However I'm now getting an empty download (size is 0 bytes) with the same code that yesterday downloaded the files from GS. Are you making some updates on the blob server? Tried uploading a new file to downloadables but also that one is returning an empty file. File sizes are however listed correctly on the Downloadable Content page.
Jussi Härkönen
I'm trying to set up .ogg audio file streaming with unity and encountered the following problem; the download url returned by GameSparksApi.getDownloadableRequest is something like this (some id's scrambled):
http://gamesparksbetabinaries.blob.core.windows.net/game-123456/123456789-Dj%20Tabora%20-%20Dashboard%20Baby.ogg?sp=r&sr=b&sv=2012-02-12&se=2014-05-27T19%3A30%3A32Z&st=2014-05-12345678&sig=12345678
The url parameters confuse UnityEngine.WWW:GetAudioClip so that it fails to detect audio format:
Unable to determine the audio type from the URL (<see above>) . Please specify the type.
UnityEngine.WWW:GetAudioClip(Boolean, Boolean)
Any ideas how to resolve this? Would it be possible to embed the url parameters with slashes, eg. http://www.domain.com/param1/param2/param3/filename.ogg? This is hardly worth the trouble for this particular case but this same problem could emerge elsewhere as well. Ideally this should be fixed in unity so that it would omit the url parameters but you can't expect them to do anything about it.
Hi Jussi
Thanks for the code, it seem we had a missing crossdomain.xml on the blob storage that is required for you to use the WWW class in the unity editor.
You code is now working for me, and you'll not have the issue again.
Gabriel
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstTech Support
Hi Jussi
I've just looked through the source for the WWW class, and GetAudioClip is overloaded. There is a version with 3 parameters where you can pass in the type of the audio as AudioType.OGGVORBIS.
If this doesn't work for you, could you share some code?
Thanks
Gabriel
Jussi Härkönen
Oops didn't notice that overload - thanks for pointing this out. However I'm now getting an empty download (size is 0 bytes) with the same code that yesterday downloaded the files from GS. Are you making some updates on the blob server? Tried uploading a new file to downloadables but also that one is returning an empty file. File sizes are however listed correctly on the Downloadable Content page.
Tech Support
Hi Jussi
Thanks for the code, it seem we had a missing crossdomain.xml on the blob storage that is required for you to use the WWW class in the unity editor.
You code is now working for me, and you'll not have the issue again.
Gabriel
Jussi Härkönen
Confirmed that the downloads work now. Thanks for your support with my silly RTFM issue :D
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics