O
O
Olga2014-03-29 11:46:58
Internet radio
Olga, 2014-03-29 11:46:58

ASP.NET How to implement radio?

I am writing a web application in ASP.NET that should play several tracks in a circle, like a radio, i.e. each new connected client should hear not from the first song and not from the beginning, but from a certain moment. The tracks are stored in LOBs in Oracle, there were no problems with extraction. There is an aspx page that has a tag and the ashx file is specified as src.
The situation is as follows: in this handler there is a cycle that retrieves the track from the database and writes it to the MemoryStream, then inside there is another cycle that reads and writes bit by bit from the MemoryStream and writes to context.Response.OutputStream.Write(buffer, offset, lengthRead) and pushes context.Response.Flush() The first track passes perfectly and plays on the page, but when the track ends and a new loop step begins, i.e. i go up to fetch the new track from the db, it gets fetched and even written to context.Response.OutputStream.Write(buffer, offset, lengthRead); (looked with a debugger), BUT DOES NOT PLAY!
Why is this happening? Or maybe change the scheme altogether? Please suggest whatever comes to mind. Thank you!
PS We are not talking about connecting clients and shifting yet, the question remains how to put several tracks in a circle for broadcasting on a page (I repeat that everything goes well with one track).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikolai Turnaviotov, 2014-04-01
@foxmuldercp

Em. and why is it necessary?
In general, it's better to already find and install a ready-made server - a library that plays music at a certain URL thread and configure this url on your page.
but in general, music on sites without the user's request is a very bad tone, except for the option of online radio.
But usually all normal players are able to pull music from the network themselves

Similar questions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question