[PHP] can I join two mp3 files with php

2005-04-19 Thread QT
dear sir,

any idea how can I join two mp3 file with php

best regards

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] can I join two mp3 files with php

2005-04-19 Thread Jay Blanchard
[snip]
any idea how can I join two mp3 file with php
[/snip]

if(!function_exists('file_put_contents')) {
  function file_put_contents($filename, $data, $file_append = false) {
   $fp = fopen($filename, (!$file_append ? 'w+' : 'a+'));
   if(!$fp) {
 trigger_error('file_put_contents cannot write in file.',
E_USER_ERROR);
 return;
   }
   fputs($fp, $data);
   fclose($fp);
  }
} 

$bar = file_get_contents(2.mp3);
file_put_contents(1.mp3, $bar, true);

But I don't think that this will work the way that you would expect it
to.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] can I join two mp3 files with php

2005-04-19 Thread QT
hi,

is it easy like this, I tried and works good. Shouldn't I need to handle
something inside mp3? just easy to put each file together in the another
file?

Best Regards


Jay Blanchard [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
[snip]
any idea how can I join two mp3 file with php
[/snip]

if(!function_exists('file_put_contents')) {
  function file_put_contents($filename, $data, $file_append = false) {
   $fp = fopen($filename, (!$file_append ? 'w+' : 'a+'));
   if(!$fp) {
 trigger_error('file_put_contents cannot write in file.',
E_USER_ERROR);
 return;
   }
   fputs($fp, $data);
   fclose($fp);
  }
}

$bar = file_get_contents(2.mp3);
file_put_contents(1.mp3, $bar, true);

But I don't think that this will work the way that you would expect it
to.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] can I join two mp3 files with php

2005-04-19 Thread QT
thank you very much

it works with mp3 good. But when I try with amr, it doenst work. I think
first amr files put some time limit and player stop at time limit. Now I am
looking to find how can I convert mp3 to amr. Because I need to have amr
file at the end

best regards
Jay Blanchard [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
[snip]
any idea how can I join two mp3 file with php
[/snip]

if(!function_exists('file_put_contents')) {
  function file_put_contents($filename, $data, $file_append = false) {
   $fp = fopen($filename, (!$file_append ? 'w+' : 'a+'));
   if(!$fp) {
 trigger_error('file_put_contents cannot write in file.',
E_USER_ERROR);
 return;
   }
   fputs($fp, $data);
   fclose($fp);
  }
}

$bar = file_get_contents(2.mp3);
file_put_contents(1.mp3, $bar, true);

But I don't think that this will work the way that you would expect it
to.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] can I join two mp3 files with php

2005-04-19 Thread Marek Kilimajer
QT wrote:
thank you very much
it works with mp3 good. But when I try with amr, it doenst work. I think
first amr files put some time limit and player stop at time limit. Now I am
looking to find how can I convert mp3 to amr. Because I need to have amr
file at the end
The mp3 file is technicaly broken, but fortunately for you mp3 files are 
self-synchronizing streams

There is no php mp3 to amr converter, but search for something you can 
execute from php. google for mp3 to amr and wav to amr

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] can I join two mp3 files with php

2005-04-19 Thread QT
I found an exe file, can I run that ms-dos exe file on linux machine with
php?

I didn't try anything like this before

Marek Kilimajer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 QT wrote:
  thank you very much
 
  it works with mp3 good. But when I try with amr, it doenst work. I think
  first amr files put some time limit and player stop at time limit. Now I
am
  looking to find how can I convert mp3 to amr. Because I need to have amr
  file at the end

 The mp3 file is technicaly broken, but fortunately for you mp3 files are
 self-synchronizing streams

 There is no php mp3 to amr converter, but search for something you can
 execute from php. google for mp3 to amr and wav to amr

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] can I join two mp3 files with php

2005-04-19 Thread Marek Kilimajer
QT wrote:
I found an exe file, can I run that ms-dos exe file on linux machine with
php?
I didn't try anything like this before
First, check if it's really for ms-dos. Command line does not mean 
ms-dos, it can be a WIN32 command line binary.

If it's really ms-dos executable, use dosemu. If it's WIN32 binary, try 
wine.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] can I join two mp3 files with php

2005-04-19 Thread QT
thank you very much I will try

Marek Kilimajer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 QT wrote:
  I found an exe file, can I run that ms-dos exe file on linux machine
with
  php?
 
  I didn't try anything like this before

 First, check if it's really for ms-dos. Command line does not mean
 ms-dos, it can be a WIN32 command line binary.

 If it's really ms-dos executable, use dosemu. If it's WIN32 binary, try
 wine.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] can I join two mp3 files with php

2005-04-19 Thread Rory Browne
Are you on Windoze or Linux. If you're on linux, I'm sure you could
rig up something with mencoder.

If you're on windoze, you might still be able to use mencoder, but I'm
not sure, and you may find yourself with the need to explore other
options.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] can I join two mp3 files with php

2005-04-19 Thread Richard Lynch
On Tue, April 19, 2005 1:17 pm, QT said:
 is it easy like this, I tried and works good. Shouldn't I need to handle
 something inside mp3? just easy to put each file together in the another
 file?

Some players will play it, and some won't.

Technically, it's an invalid MP3, but most players will ignore the extra
data in the middle of your file.

Check into the PHP ID3 software.

In addition to being able to add ID3 meta tags to MP3s I'm pretty sure it
can correctly append MP3s and fix all the data up correctly so it is a
totally legit MP3, instead of one that happens to work in most players.

It might even handle amr files, whatever those are.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php