473,386 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

downgrade wav file

Anyone knows how to downgrade wav file? For example downgrade from 22k
16-bit wav file to 8k 8-bit wav file ?

May 3 '06 #1
2 3343
First of all, by "22k" and "8K" I'm going to assume that you are
referring to the sampling rate, and not the file size.

To change the sampling rate, changing to a factor of the current rate
is much easier. To go from 22k to 11k, you just skip every other one.
22k->5.5k, skip 3 of every 4.

To go from 22k to 8k, you want to keep 4 out of every 11 samples. The
trick is that 3 of those four sample don't align with existing samples,
so you'll have to interpolate to find out what they should be.
Basically, you have to mathematically recreate the wave form that the
samples represent, and then resample the wave at the new rate.
For example, the first 8k sample is 2/3rds the way from the 2nd to
the 3rd sample. The second is half-way between the 5th & 6th. The
third is 1/3rd the way from the 8th to the 9th. And finally, the fourth
is exactly the 11th.
So, given 22k samples of :
10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110
The translated 8k samples would be:
26, 55, 83, 110

Changing for 16-bit to 8-bit is simpler. 16-bit samples describe the
height of the wave form using numbers in the range of -32767 to +32767.
8-bit samples do the same thing, using numbers in the range -127 to
+127. To convert 16bits to 8bit, you must convert the ranges, which is
basically dividing by 256, which comes down to simply taking the
high-order byte of the 16-bit sample.

May 3 '06 #2
Heidi,
Ianier Munoz, an MVP from Belgium, has some excellent C# code to manipulate
Wav streams and the Wav headers to change / resample a wav file.
You can find some of his stuff on codeproject.com
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"he******@gmail.com" wrote:
Anyone knows how to downgrade wav file? For example downgrade from 22k
16-bit wav file to 8k 8-bit wav file ?

May 3 '06 #3

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

Similar topics

3
by: Richard Shea | last post by:
Hi - I have just installed ZODB for the first time. However after I'd finished I realised that I'd installed a development release and not a stable release so I'd like to downgrade or remove the...
3
by: joshsackett | last post by:
Hi all, I was running an MSDN version of SQL 2000 Developer Edition on a server until I accidentally upgraded it to Enterprise Edition while attempting to install some Management Tools. Is it...
1
by: Matt S | last post by:
Does the liscense for the VC++.Net 2003 allow the user to purchase a downgrade to VC++.NET 2002? DO I need to buy a standard version of VC++.NET to downgrade? I need to get VC++ 2002, but I can't...
4
by: Hyo-Han Kim | last post by:
Hi.. someone built app. with VC++.NET .. But It cause error on Windows 98 SE .. No one can correct the error. So I would like to downgrade the app to VC++ 6.0 .. The application should...
0
by: Eric | last post by:
I have downgrade discs from MS that are no longer available. Downgrade legally from VB.net to VB6. eric3@bigfoot.com
7
by: Sharon | last post by:
Hey. Any of you know a tool that can help downgrade a 2.0 application to 1.1? Thanks, Sharon.
0
by: rdraider | last post by:
Does anyone know more details about "downgrade rights". Do you need to ask MS for this right? How do you get a CD key (a legit key) for SQL 2000 if you urchase SQL 2005. From MS Licensing FAQ...
5
by: incrediblesuperdude | last post by:
Hi everybody, I have a problem with a bug in the sp1 of .Net 2.0 which is reported on this page: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx... Because of this a...
0
by: Garima12 | last post by:
Can I downgrade dbase 7 to dbase 4 file using command line?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.