I'm getting strange behavior when trying to access the track stream. The is further complicated by the fact that it is not consistent across all tracks. Some tracks will occasionally work, and then stop. I have a slightly better experience when running this locally, vs on my hosting platform (godaddy).
Here's the code:
public FileStreamResult Track(string id) {
var clientId = ConfigurationManager.AppSettings["soundCloudClientId"];
var clientSecret = ConfigurationManager.AppSettings["soundCloudClientSecret"];
var username = ConfigurationManager.AppSettings["soundCloudUserName"];
var password = ConfigurationManager.AppSettings["soundCloudPassword"];
ISoundCloudConnector soundCloudConnector = new SoundCloudConnector();
var soundCloudClient = soundCloudConnector.DirectConnect(clientId, clientSecret, username, password);
using (var fileStream = soundCloudClient.Track(id).GetStream()) {
return new FileStreamResult(fileStream, "audio/mpeg");
}
}
I'm getting strange behavior when trying to access the track stream. The is further complicated by the fact that it is not consistent across all tracks. Some tracks will occasionally work, and then stop. I have a slightly better experience when running this locally, vs on my hosting platform (godaddy).
Here's the code: