File Format

This is a discussion on File Format within the PHP General forums, part of the PHP Programming Forums category; Wave editor? Here is my dilemma. In php I have written a script to upload a wave file to the ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-11-2008
admin@buskirkgraphics.com
 
Posts: n/a
Default File Format

Wave editor?
Here is my dilemma.

In php I have written a script to upload a wave file to the server for the C Sharp application to use. No problems on upload or streaming from the file to the web. My issue comes when the format of the wave file is PCM and not CCITT u-Law. The device cannot play a PCM formatted wave file. Problem comes in when the end user just picks a wave file to use for this option and does not have the format correct.

Is there a wave format change option in php?
Has or does anyone know of a solution in php for this?
Is there a way I can check the format of the wave file before uploading?



Richard L. Buskirk
Reply With Quote
  #2 (permalink)  
Old 04-12-2008
Bojan Tesanovic
 
Posts: n/a
Default Re: [PHP] File Format

I bet there is no native PHP methods for that kind of file, but you
can easily check the headers of wave file , you need to have a
specification or at least have 3 wave files of PCM and CCITT ,
compare the first 100 characters of that file, and you will get the clue
and logic how to recognize one from the other.
in PHP open a file read 100++ bytes and apply a logic to distinguish
formats.

After that you can use some external program to convert from one
format to other eg

<?php

system(' wavconvert_to_CCITT.exe some_pcm.wave ') ;
?>




On Apr 11, 2008, at 9:20 PM, admin@buskirkgraphics.com wrote:

> Wave editor?
> Here is my dilemma.
>
> In php I have written a script to upload a wave file to the server
> for the C Sharp application to use. No problems on upload or
> streaming from the file to the web. My issue comes when the format
> of the wave file is PCM and not CCITT u-Law. The device cannot play
> a PCM formatted wave file. Problem comes in when the end user just
> picks a wave file to use for this option and does not have the
> format correct.
>
> Is there a wave format change option in php?
> Has or does anyone know of a solution in php for this?
> Is there a way I can check the format of the wave file before
> uploading?
>
>
>
> Richard L. Buskirk
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


Igor Jocic
http://www.carster.us/





Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:17 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0