angelu2001 / php-reader

Automatically exported from code.google.com/p/php-reader
0 stars 0 forks source link

Manipulate binary data stored on a variable instead of physical files #24

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'd like to have a feature wherein I will pass a data to a function and
will read/write ID3 Tags onto it instead of creating a file and
manipulating the file. I have lots of audio contents stored on a database
and I would like to put tags onto the files on-the-fly. I would like to
avoid lots of IO.

Original issue reported on code.google.com by mprotaci...@gtempaccount.com on 28 Dec 2009 at 1:23

GoogleCodeExporter commented 8 years ago
So you want to read and write ID3 tags from/to memory? Is that it?

Original comment by svollbehr on 28 Dec 2009 at 2:46

GoogleCodeExporter commented 8 years ago
exactly!

Original comment by mprotaci...@gtempaccount.com on 28 Dec 2009 at 3:08

GoogleCodeExporter commented 8 years ago
Check out the new release of the Zend_Media_Id3v2 class (or checkout the SVN 
branch
'zend'). It supports also a Zend_Io_StringReader instance as an input parameter 
to
the constructor. You can use that to enable in-memory processing. You may also 
write
the tag to a memory stream using Zend_Io_StringWriter instance as the target.

This way you can select the music file from the database into the memory stream,
process it in the memory and then store it back to the database without any 
file I/O
at all.

Original comment by svollbehr on 28 Dec 2009 at 3:13