public bool open(string file) { if (nativeObj_ != null) { return(nativeObj_.open(file) == EngineError.OK); } return(false); }
/// <summary> /// Opens an asset for playback. Currently .wav and .opus formats are supported. If no path is specified, /// the asset will be loaded from Assets/StreamingAssets. /// While the asset is opened synchronously, it is loaded into the streaming buffer asynchronously. An /// event (Event.DECODER_INIT) will be dispatched to the event listener when the streaming buffer is ready for the /// asset to play. /// </summary> /// <param name="fileToplay">Name of the file in StreamAssets or the full path</param> /// <returns>true if the file was found and successfully opened</returns> public bool open(string fileToplay) { if (nativeObj_ != null) { if (nativeObj_.open(Utils.resolvePath(fileToplay, PathType.STREAMING_ASSETS)) == EngineError.OK) { file = fileToplay; return(true); } } return(false); }