![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Newbie
Join Date: Feb 2007
Posts: 6
Rep Power: 0
![]() |
Removing the wav header
Ha. Well, would you be able to point me in the direction of how to remove the wav header that your code added? Also, how would I remove the header of a jpg BEFORE turning it into a wav with your code? I'd like to remove the header of jpg, turn it into a wav, manipulate the wav in an audio program and then pull the wav header off and put a fresh jpg header on there. I'd like to see how that effects the image. Maybe thats a tall order but I'm hoping its all pretty much the same code, just specifying a few different parameters. Thanks for all of your help already.
|
|
|
|
|
|
#12 |
|
Caffeinated Neural Net
![]() Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,005
Rep Power: 5
![]() |
DaWei's method is a good example of how to do the image-to-sound conversion (indeed, it should work for any arbitrary sequence of binary data, whether that is an image, program, or whatever). However, it seems to me that if you pumped something like a .JPG or .GIF into it, it wouldn't work for your purposes. Sure, the digital output of the program could be converted back to its original form (since there were no lossy algorithms employed in the conversion to PCM data in the first place), but once you store it on analog media (such as vinyl), you will not have this exactness. For formats that are compressed or otherwise encoded in some manner, this will probably cause the decompressor/decoder to choke on the data.
However, it seems to me it would be entirely possible to treat the analog data as raw image data. A Windows .BMP file is a good example. You digitize the analog data, then when you know the amount, you can build a bitmap image from it by writing the header that describes the image (width, height, pixel format, etc), then following it with the digitized data (note that a Windows .BMP sometimes requires padding bytes after each scanline to maintain alignment, so this needs to be accounted for). You could then convert this to a .JPEG file if you wanted. My point is that when converting an image to sound, use raw image data (no headers, palette table, etc). When converting it back, you will (hopefully) get a fairly close reproduction of the original, but there will be some 'noise' in the image, as there will be some loss of signal in the digital -> analog -> digital conversions. Also, you may find it a good idea to have your image start with a series of all-black pixels followed by a white pixel. You would use this to find the 'start' of the signal. Otherwise, your data would probably not be aligned to the right bit, and it would throw the whole thing off.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot. - Vaarsuvius, Order of the Stick |
|
|
|
|
|
#13 |
|
Professional Programmer
|
I believe that there was a failed video format that worked on similar technology. Failed in the sense that it didn't catch on, not that it didn't work. I'm too tired to look it up, but I believe that it's somewhere in wikipedia's video formats/ recorders area. It may be a good way to get some background information.
Also consider that if you press this onto a vinyl record, anyone listening to it will probably get some pretty nasty sound, so I would definetly reccomend clearly marking your records for your listerners' sake.
__________________
Perhaps I should have a sticky topic for all of the times I "return" to this forum instead of a new one every time. |
|
|
|
|
|
#14 |
|
Hobbyist Programmer
Join Date: Jun 2006
Location: Ireland
Posts: 152
Rep Power: 3
![]() |
It seems to me that the key here is you need a way of encoding digital data into analog sound and then back again. As a bonus you probably wouldn't need 100% perfect transmission as you could use an image format which would be somewhat error tolerant.
Unfortunately the decoding step will not be automatic, you'd also need to provide a utility for that purpose.
__________________
Visit my website BinaryNotions. |
|
|
|
|
|
#15 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
You could, for instance, convert a digital movie to NTSC (analog), reproduce/play that as sound, then replay it as a TV movie while recapturing the digital with something like FRAPS.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#16 |
|
Newbie
Join Date: Feb 2007
Posts: 6
Rep Power: 0
![]() |
image formats
What image format do you think is going to have the greatest tolerance? Someone mentioned BMP.
I'm guessing that whatever format I use I should convert it to a wav file only after I remove the image header so that any distortion in the analogue realm doesn't affect the format's ability to be read when decoded it only affects the quality of the image. A small utility would then decode the information and put a fresh image header back onto the data. Where can I go to learn more about pulling headers off of files and adding headers to files? Last edited by formasfunction; Feb 18th, 2007 at 10:24 AM. |
|
|
|
|
|
#17 | |
|
Caffeinated Neural Net
![]() Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,005
Rep Power: 5
![]() |
Quote:
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot. - Vaarsuvius, Order of the Stick |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Advanced Question: Reading Bitmaps | prototype_angel | C++ | 6 | Dec 8th, 2006 4:48 AM |
| Questions about extra Sound and Graphics libraries | Soulstorm | C++ | 2 | May 15th, 2006 10:42 AM |
| Attitudes | Oddball | Coder's Corner Lounge | 29 | Mar 18th, 2006 9:34 PM |
| might sound like a stupid question... | jobobshishkabob | HTML / XHTML / CSS | 11 | Jan 29th, 2006 11:55 AM |
| turning integers into sound? | clam | Visual Basic .NET | 2 | Aug 23rd, 2005 1:28 PM |