Hello.
I’m making a game and this is like a level editor that I’m doing at the moment.
The player selects a song title and a song artist. The player then chooses a .ogg file from their HDD.
The .ogg file gets stored as “StreamingAssets/tempSong/songArtist/songTitle/song.ogg”
Next the player plays the song. I have this code
using (UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip("File://" + Application.streamingAssetsPath + "/tempSong/" + songInfo.songArtist + "/" + songInfo.songTitle + "/song.ogg", AudioType.OGGVORBIS))
{
yield return www.SendWebRequest();
song = DownloadHandlerAudioClip.GetContent(www);
Now all of this seems to work except the song loading as an audioclip. The script loads a file, but it’s blank. Next to "Song: " it’s just the icon of an audioclip and a blank name.
Now after struggling with this for a few days I noticed that dragging an .ogg file into the StreamingAssets folder doesn’t really seem to import anything. It’s just blank on the inspector. If I drag it into any other folder I get the sound wave, the import options, etc. Is this the problem?
The reason I’m using StreamingAssets is because I want the player to be able to take the files out of the folder when they’re done and drag it into the actual games folder. Perhaps this isn’t the best way to go about users adding content?
Sorry if it’s confusing. I’ve been struggling with this for the last few days and my brain is mushed.
Thanks!