Re: Embedding mp3 - Answered.
Darren Cook <[email protected]> Fri, 02 Jan 2004 17:28:54 +0900
| Newsgroups | gmane.comp.web.ming.general |
|---|---|
| Message-ID | <[email protected]> |
> can you try whether replacing getInput() [file php_ext/ming.c] by this code works:
Yes, it does work now, thanks. And it is embedded, and I've confirmed I can
remove the original mp3 file and it still works.
My test mp3 is 133,329 bytes.
With no compression ming gives me a file of 137,364 bytes.
With level 9 compression I get 133,137 bytes.
The Flash authoring tool gave me 132,661 bytes (but I've not checked
settings - it could've been doing some lossy compression I suppose).
BTW, after looking at source I saw I can have number of frames required
calculated automatically for me:
$len=$m->streamMp3($fp);
$m->setFrames($len);
Darren
> -----------
> static SWFInput getInput(zval **zfile TSRMLS_DC)
> {
> FILE *file;
> void *what;
> int type;
> SWFInput input;
>
> what = zend_fetch_resource(zfile TSRMLS_CC, -1, "File-Handle", &type, 1, php_file_le_stream());
>
> if (php_stream_cast((php_stream*)what, PHP_STREAM_AS_STDIO, (void *) &file, REPORT_ERRORS) != SUCCESS) {
> return NULL;
> }
>
> input = newSWFInput_file(file);
> zend_list_addref(Z_LVAL_PP(zfile));
> zend_list_addref(zend_list_insert(input, le_swfinputp));
> return input;
> }
> ----------
>
> Wolfgang
>
> _______________________________________________
> ming-fun mailing list
> [email protected]
> http://www.opaque.net/mailman/listinfo/ming-fun
>
>
>