473,321 Members | 1,778 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,321 software developers and data experts.

I can see the music!

Convert WAV To BMP And Back

On RentaCoder one of the other coders thought I just wanted him to
change the extension from WAV to BMP. Another coder brought up the
complexities of actually converting WAVs to JPGs and back again,
because JPGs are compressed. And someone else asked me how they could
actually convert it. It is easiest if we work with BMPs and WAVs
because if we worked with BMP image files you just have to get into the
binary code of the file, and swap the headers around. So as long as
photoshop thinks the WAV is a BMP file you will be able to see what it
looks like and modify it. But I don't expect a graphical
representation that looks like a traditional wav file. I expect a 1
dimensional colorful psychedelic mess. I might have to add more
dimensions to the image, depending on the frequency of the samples in
the music. It just depends on how many colors I have to work with.

It would be nice if we could do all of this live, and while I was
editing in photoshop it could show me a convenient display of what the
WAV file was intended to look like. But we will need to run
experiments to see how the file size of WAVs and BMPs relate to the
headers. The content of the files doesn't matter it is all 1s and 0s,
the headers determine the size.

I would like to be able to blend music in photoshop by mixing layers of
wav files. I can take two recordings of someone singing the same song,
and blend them together in photoshop. An example could be taking a
robot voice that sings a song, and then blending it with my voice while
I am singing. To create a more realistic robot. This is one of the
techniques they are using to make music in holywood.

I have the software to do the job now. I've downloaded 010 Editor,
which is a Hex Editor that understands how to interpret binary file
formats and has a scripting side program that can let you make
automatic conversions between files. Sweet!
audio code LPCM
Parameters 1 channels 8 bits
32000 Sampling Freq.
256 Bitrate kbps
WAV's made with tools on http://jsoto.posunplugged.com/audiotools.htm
1 sample
--------
:struct WAVRIFFHEADER header
: ID groupID[4] RIFF
: ID groupID[0] 82'R'
: ID groupID[1] 73'I'
: ID groupID[2] 70'F'
: id groupID[3] 70'f'
: long size 37
: ID riffType[4] WAVE
: ID riffType[0] 87'W'
: ID riffType[1] 65'A'
: ID riffType[2] 86'V'
: ID riffType[3] 69'E'
:struct FORMATCHUNk format
: ID chunkID[4] fmt
: ID chunkID[0] 102'f'
: ID chunkID[1] 109'm'
: ID chunkID[2] 116't'
: ID chunkID[3] 32' '
: long chunkSize 16
: short wFormatTag 1
: unsigned shortwChannels 1
: unsigned long dwSamplesPerSec 32000
: unsigned long dwAvgBytesPerSec 32000
: unsigned short wBlockAlign 1
: unsigned short wBitsPerSample 8
:
:struct DATACHUNK data
: ID chunkID[4] data
: ID chunkID[0] 100'd'
: ID chunkID[1] 97'a'
: ID chunkID[2] 116't'
: ID chunkID[3] 97'a'
: long chunkSize 1
: uchar samples[1]
: uchar samples[0] 0
10 sample
---------

:struct WAVRIFFHEADER header
: ID groupID[4] RIFF
: ID groupID[0] 82'R'
: ID groupID[1] 73'I'
: ID groupID[2] 70'F'
: id groupID[3] 70'f'
: long size 46
: ID riffType[4] WAVE
: ID riffType[0] 87'W'
: ID riffType[1] 65'A'
: ID riffType[2] 86'V'
: ID riffType[3] 69'E'
:struct FORMATCHUNk format
: ID chunkID[4] fmt
: ID chunkID[0] 102'f'
: ID chunkID[1] 109'm'
: ID chunkID[2] 116't'
: ID chunkID[3] 32' '
: long chunkSize 16
: short wFormatTag 1
: unsigned shortwChannels 1
: unsigned long dwSamplesPerSec 32000
: unsigned long dwAvgBytesPerSec 32000
: unsigned short wBlockAlign 1
: unsigned short wBitsPerSample 8
:
:struct DATACHUNK data
: ID chunkID[4] data
: ID chunkID[0] 100'd'
: ID chunkID[1] 97'a'
: ID chunkID[2] 116't'
: ID chunkID[3] 97'a'
: long chunkSize 10
: uchar samples[10]
: uchar samples[0] 0
: uchar samples[1] 0
: uchar samples[2] 0
: uchar samples[3] 0
: uchar samples[4] 0
: uchar samples[5] 0
: uchar samples[6] 0
: uchar samples[7] 0
: uchar samples[8] 0
: uchar samples[9] 0


100x100 pixels: 29.3 KB (30,056 bytes)
1x1 pixels: 60 bytes (60 bytes)
resulution 72 pixels/inch
Color Moder: RGB 8 Bit
Depth 24 Bit
- saved in photoshop -

1x1 BMP
-------

:struct BITMAPFILEhEADER bmfg
: CHAR bfType[2] BM
: DWORD bfSize 60
: WORD bfReserved1 0
: WORD bfReserved2 0
: DWORD bfOffBits 54
:
:struct BITMAPinfohEADER bmih
: DWORD biSize 40
: LONG biWidth 1
: LONG biHeight 1
: WORD biPlanes 1
: WORD biBitCount 24
: DWORD biCompression 0
: DWORD biSizeImage 6
: LONG biXPelsPerMeter 2834
: LONG biYPelsPerMeter 2834
: DWORD biClrUsed 0
: DWORD biClrImportant 0
:
:struct BITMApLINE lines[1]
: struct BITMApliNE lines[0]
: struct RGBTRIPPLE colors[1]
: struct RGBTRIPlE colors[0]
: UBYTE rgbBlUE 255
: UBYTE rgbGreen 255
: UBYTE rgbRed 255
: UBYTE padBytes[1]
: UBYTE padBytes[0] 0
:
:

100x100 BMP
-----------
:
:struct BITMAPFILEhEADER bmfg
: CHAR bfType[2] BM
: DWORD bfSize 30056
: WORD bfReserved1 0
: WORD bfReserved2 0
: DWORD bfOffBits 54
:
:struct BITMAPinfohEADER bmih
: DWORD biSize 40
: LONG biWidth 10
: LONG biHeight 10
: WORD biPlanes 1
: WORD biBitCount 24
: DWORD biCompression 0
: DWORD biSizeImage 30002
: LONG biXPelsPerMeter 2834
: LONG biYPelsPerMeter 2834
: DWORD biClrUsed 0
: DWORD biClrImportant 0
:
:struct BITMApLINE lines[1]
: struct BITMApliNE lines[0]
: struct RGBTRIPPLE colors[100]
: struct RGBTRIPlE colors[0]

#FFFFFF
: UBYTE rgbBlUE 255
: UBYTE rgbGreen 255
: UBYTE rgbRed 255
: ...
:
: struct RGBTRIPlE colors[99]

#FFFFFF
: UBYTE rgbBlUE 255
: UBYTE rgbGreen 255
: UBYTE rgbRed 255
: ...
:
: struct BITMApliNE lines[99]
: struct RGBTRIPPLE colors[100]
: struct RGBTRIPlE colors[0]

#FFFFFF
: UBYTE rgbBlUE 255
: UBYTE rgbGreen 255
: UBYTE rgbRed 255
: ...
: struct RGBTRIPlE colors[99]

#FFFFFF
: UBYTE rgbBlUE 255
: UBYTE rgbGreen 255
: UBYTE rgbRed 255
:
:

Aug 24 '06 #1
2 1675

<vi***********@gmail.comwrote in message
news:11*********************@m79g2000cwm.googlegro ups.com...
Convert WAV To BMP And Back
So, which part of "Off-Topic" did you not understand?
Aug 24 '06 #2
Howard wrote:
<vi***********@gmail.comwrote in message
news:11*********************@m79g2000cwm.googlegro ups.com...
>Convert WAV To BMP And Back

So, which part of "Off-Topic" did you not understand?
Glad you liked my reply to Corey, Howard. :-)
Aug 24 '06 #3

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

Similar topics

12
by: Marian Aldenhövel | last post by:
Hi, I am trying to make pygame play music on windows. This simple program: import pygame,time pygame.init() print "Mixer settings", pygame.mixer.get_init() print "Mixer channels",...
20
by: gallery | last post by:
Our client insists on having a music loop playing as the visitor travels throughout his new HTML website. We will not be doing this in frames and I would prefer not to have the home page spawn...
2
by: Just Me | last post by:
If I use the shell32q.NameSpace(k) and the Parent property I can develop, for example, the path to My Music. Actually it ends with Desktop but Desktop can also be traced by using Parent to...
4
by: Doug van Vianen | last post by:
Hi, I am using Visual Basic 6 to generate web pages that can be used by the members of our seniors' computer club to create e-cards that include their own pictures. I wish to include background...
14
by: gnarl | last post by:
Hello all, I'm developing a site in PHP4 for a music artist, who wants music to play across all their pages. I have loaded a simple flash applet to play the music, but every time the visitor to...
2
by: FlashForumKB | last post by:
Here is a chance for you to make my developers look bad. I have hired these guys to development my website which, in part, has music demos available to my users. These demos must include the...
2
pbmods
by: pbmods | last post by:
At the request from MacMan247, I am hereby posting the 'how I did it' to get the music from ShadowWraith. Here's what I did. Turns out that the music is stored in MOD format inside the...
2
by: Suresh P | last post by:
Hi All, Is there any way other than frames to play music in the background of the website without restart while navigating to different pages of the website. Because, frames will affect the...
11
by: globalrev | last post by:
http://www.pygame.org/docs/ref/mixer.html import pygame #pygame.mixer.init(frequency=22050, size=-16, channels=2, buffer=3072) //it complained abiout words= so i guess its only the nbrs...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.