- Home /
iTunes COM for Windows SDK giving runtime error
I'm using iTunes COM for Windows SDK to control iTunes and get song info. Controlling play/pause/etc. works perfect, but getting song info doesn't. Everything I tried using the iTunes SDK works, except for CurrentTrack, which gives a runtime error.
Does anyone have an idea how to fix this?? If you need more info, please ask.
Code:
using UnityEngine; using System.Collections; using iTunesLib;
public class TestiTunes:MonoBehaviour { void Start() { iTunesApp app = new iTunesAppClass(); IITTrack track = app.CurrentTrack; // CRASH if app.CurrentTrack != null } }
EDIT:
It seems to be unable to handle anything of the type IITTrack. If I take a track of the current playlist, it also crashes. It doesn't crash though if there isn't a current track. I then just get an warning saying I'm referencing to a null object.