Play or download wav file from MySQL: Play or download wav file from MySQL without writing to disc.
I need to play or download wav file from MySQL without writing to disc.
Is the .wav file stored in DB as BLOB or what?
I don't know if it is possible to do that or even desirable.
What happens is that when you use unbuffered queries, while the database client is retrieving data from the database, an implicit transaction is going, meaning that you may be implicitly locking the tables until the whole result set is retrieved.
Still MySQLi has the store_result function for the statement objects. It retrieves and store the whole result set so will not hold the result set. I am just not sure if the result set is stored in memory or in a temporary file to avoid exhausting PHP memory to the limit.
Anyway, I don't know of a class that can do that so far.
Do you have .wav already in DB or you just planing to use DB for.wav?
If you just planing, probably it's better to store them like common files. Flash players (I have such a player) and HTML5 players (I guess) allow to start playing media before whole file uploaded to browser.
By the way, MySQL DB is also stored on disc.
you may find your happiness here.