1

I use Filestream for storing audio files(mp3) in MS SQL Server'08.

I need to play these files on client(html+javascript), so how to get an url to real file?

I have a WCF Service, I tried to send a byte array to client, but I don't know how to turn it to audio using javascript.

Therefore I ask about another method to play audio files, maybe it's possible to turn BLOB from database back to mp3 and give client a link?

Thanks

Ilya Blokh
  • 11,923
  • 11
  • 52
  • 84

1 Answers1

0

I didn't understand your question well, But I think that may help

To Store and read audio file from SQL server using .Net, You may follow this link http://www.codeproject.com/KB/database/AudioInSQLServer.aspx (creates a temp file for that)

So using your WCF service, you may read the byte array, and at your client, read this byte array , create temp .wma file and run it.

  • Thanks!It seems that I need, but my client supports only html+javascript code. Also I have mp3 format, but maybe it isn't very important. – Ilya Blokh Aug 07 '11 at 13:29
  • it's about java, not javascipt – Ilya Blokh Aug 07 '11 at 13:37
  • Sorry for that :) http://stackoverflow.com/questions/187098/cross-platform-cross-browser-way-to-play-sound-from-javascript – Sameh Aboelnil Aug 07 '11 at 13:40
  • I know how to play a mp3 file from javascript, but I have only a byte array. How to turn byte array to mp3 file? - this is the question. Or to find another way to play file, for example making smth like a link to it – Ilya Blokh Aug 07 '11 at 14:07
  • Well, Don't know perfect solution, although this may work ( http://stackoverflow.com/questions/6937917/turn-byte-array-to-sound ) – Sameh Aboelnil Aug 07 '11 at 14:27
  • Look carefully, it's my question :))) So in this post I ask about "link" alternative, not about convertation of byte array. Thanks for responces) – Ilya Blokh Aug 07 '11 at 14:41