472,958 Members | 2,318 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

.wav file header info


Does anyone know how to extract the header information like duration, bit
rate, audio channel configuration etc from a wave file? An example (if
possible) would really help ...

- Rajesh
Jul 17 '05 #1
1 23088
On Wed, 14 Jan 2004 13:59:20 -0600, "Rajesh Kapur" <rk****@mpr.org> wrote:
Does anyone know how to extract the header information like duration, bit
rate, audio channel configuration etc from a wave file? An example (if
possible) would really help ...


Or search for WAV on http://www.wotsit.org/

Use unpack <http://php.net/unpack> to decode the header. The format looks
quite simple, so here's an example.

$fp = fopen('chord.wav', 'r');
fseek($fp, 20);
$rawheader = fread($fp, 16);
$header = unpack('vtype/vchannels/Vsamplerate/Vbytespersec/valignment/vbits',


[type] => 1
[channels] => 2
[samplerate] => 22050
[bytespersec] => 88200
[alignment] => 4
[bits] => 16

Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Mich Romney & De Shriners | last post by:
I have created an MP3 download app from mysql. It plays the song fine. :) Only problem is that when it downloads, all the header information, like song lyrics, credits and album cover have all...
by: Roy | last post by:
When I do the copyRecordset method via vba to transfer data from access to excel template,i am unable to read the header info.It's only transferring data.Any suggestions?? Roy
by: opswat | last post by:
Hello, I am currently working on a C++ project for a PocketPC with Windows Mobile 5.0 in Visual Studio 2005. I am currently looking for a way to get file version information, i.e. file...
by: Frank Kociemba | last post by:
Hi NG, how can i compare, if a file ends with jpg,jpeg,gif,tif is really such a file and not an unnamed one. Is ther a solution or an example who to do it in c#? Frank
by: wednesdayuser | last post by:
How do I take part of the header info (an attribute) and add it to a url? I have the code to grab all of the header info/ session info, but I only need two or three attributes from the string it's...
by: khalidbaloch | last post by:
i want a simple function to retrive header info like bitrate playtime of a mp3 files , any help would be highly appreciated ... thanx in advance
by: empiresolutions | last post by:
I am using a standard mail function within an AMFPHP Class that i have used many times. Now, when i use it it does not work right. When a mail is sent, the $header info and html shows in the email. ...
by: turnerca902 | last post by:
Hi Folks, I am working on a little project and hoping someone out there might offer me some info/insight. I have a folder containing about 50 html files where the contents look like this: ...
by: sudhivns | last post by:
Hi, I would like to test the consistant state of PST file using MAPI API. how to read the PST header info (specifically AIMAP status flag). Does this flag denote, whether PST is corrupted or not ?...
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.