Forum Moderators: coopster

Message Too Old, No Replies

WAV file upload script

         

eatspinach

12:25 pm on Jul 1, 2009 (gmt 0)

10+ Year Member



Does anyone have any idea how i might resolve this issue, i have a file upload script, and it uploads mp3s fine, but i need it to upload wav files as well.. but it wont upload wav files...

here is my script

<?php

// Edit upload location here
//$destination_path = getcwd().DIRECTORY_SEPARATOR;
$destination_path = "audio/";

$result = 0;

$target_path = $destination_path . basename( $_FILES['myfile']['name']);

if(@move_uploaded_file($_FILES['myfile']['tmp_name'], $target_path))
{
$result = 1;
setcookie("audioFileOne", $target_path);
}

sleep(1);

?>

thanks for any suggestions / help in advance
dave

eatspinach

12:36 pm on Jul 1, 2009 (gmt 0)

10+ Year Member



actually just discovered that the file upload is working fine, the problem is in the playing back of the audio file.. silly me, sorry

eatspinach

12:52 pm on Jul 1, 2009 (gmt 0)

10+ Year Member



ahh the problem was the audio player is flash so it only plays mp3... is it possible to convert a wav file into an mp3 file with php?

eatspinach

1:11 pm on Jul 1, 2009 (gmt 0)

10+ Year Member



i found some code on this forum, but i have no idea how to implement it...

<snip>

anyone have any ideas

[edited by: dreamcatcher at 7:14 am (utc) on July 2, 2009]
[edit reason] No urls please! [/edit]

coopster

5:27 pm on Jul 6, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



is it possible to convert a wav file into an mp3 file with php?

One of the more common methods for this is to call system commands [php.net] like ffmpeg.