Sign in to follow this  
Followers 0
Black-Glawses

Binary Data and Wave Headers

5 posts in this topic

Dear sirs,

A friend of mine is using AutoIt to do some programming.

I created a DLL file for him so that he could record audio from a sound card. The API is very easy-to-use.

However, my friend asked me a few things I cannot answer; I am no AutoIt guy (I use C or C++), so I thought I might as well put the questions out here.

1) How do I read in a binary file?

(As far as I know, fread() or something similar exists in this language too)

"2) How do I add wave headers to raw audio?"

I have been struggling with that for 5 days now and cannot get it to work using C, mostly because I haven't found decent code.

My friend is, as I told you, programming in AutoIt, so if you could show an example of adding a wave header to raw audio data, he and I would be very happy (please provide the code in AutoIt).

Your help is very much appreciated.

Yours sincerely,

Peter.

http://www.tdlsoftware.org

Share this post


Link to post
Share on other sites



I don't know about wave headers but you can use the _APIFile UDFs Larry made to read and write binary files.

They can be found at the link below:

http://www.autoitscript.com/forum/index.php?showtopic=12604


HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.

Share this post


Link to post
Share on other sites

Thanks a lot for that; I just sent my friend the link.

Then, he just need the wave headers.

Thanks a lot for that,

Peter.

Share this post


Link to post
Share on other sites

Thanks a lot for that; I just sent my friend the link.

Then, he just need the wave headers.

Thanks a lot for that,

Peter.

<{POST_SNAPBACK}>

No Problem. :)

Good luck with the wave headers.


HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.

Share this post


Link to post
Share on other sites

Wave File Header - RIFF Type Chunk

Wave file headers follow the standard RIFF file format structure. The first 8 bytes in the file is a standard RIFF chunk header which has a chunk ID of "RIFF" and a chunk size equal to the file size minus the 8 bytes used by the header. The first 4 data bytes in the "RIFF" chunk determines the type of resource found in the RIFF chunk. Wave files always use "WAVE". After the RIFF type comes all of the Wave file chunks that define the audio waveform.

Offset Size Description Value

0x00 4 Chunk ID "RIFF" (0x52494646)

0x04 4 Chunk Data Size (file size) - 8

0x08 4 RIFF Type "WAVE" (0x57415645)

0x10

Wave chunks

RIFF Type Chunk Values

Wave File Chunks

Wave Format Information

- Orca of Frostmane


I AM ORCA!! A VERY POWERFUL WHALE!!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0