asp.net apicontroller

  • //API Controller method that get audio file from DB
  • Stack Overflow works best with JavaScript enabled
  • My only problem is getting the blob loaded into wavesurfer’s loadBlob().
  • I am using WavesurferJS together with .NET API and AngularJS to play audio files from the database.
  • Gone); } else { //send file to client byte[] audioBytes = audio.content; result = Request.

I am using WavesurferJS together with .NET API and AngularJS to play audio files from the database. My only problem is getting the blob loaded into wavesurfer’s loadBlob().

@MeggaTym: If any geek out there could answer my question on #stackoverflow I’d really appreciate it!

Here’s what I’ve done so far…

$scope.getTrack = function () { $http({ method: ‘GET’, url: ‘/api/track/’ + $routeParams.id, responseType: ‘arraybuffer’, headers: { ‘Access-Control-Allow-Origin’: ‘*’ } }).success(function (data, status, headers) { headers = headers(); var contentType = headers[‘content-type’]; var blob = new Blob([data], { type: contentType }); $scope.audioURL = window.URL.createObjectURL(blob); }).error(function (message) { //handle error here }); }

var wavesurfer = WaveSurfer.create({ container: ‘.waveform’, waveColor: ‘violet’, progressColor: ‘purple’, barWidth: 2, }); wavesurfer.loadBlob(‘How do I get my blob here?’);

asp.net apicontroller

You might also like More from author

Comments are closed, but trackbacks and pingbacks are open.