EmbDev.net

Forum: µC & Digital Electronics Get Binary-Data from Wav-File


Author: Samuel_Schmid (Guest)
Posted on:

Rate this post
0 useful
not useful
Hello

I want to play a sound with a microcontroller. I have the whole circuit 
but I hava a problem with the sound data.

I have the sound in a wav-file but I'm not able to get the binary-data 
out of it. Does anybody know how I can get this data out of a wav-file?

Thanks a lot

Samuel_Schmid

Author: Martin Thomas (mthomas) (Moderator)
Posted on:

Rate this post
0 useful
not useful
I wonder if you even tried to search the net a little bit. You may start 
here: http://en.wikipedia.org/wiki/WAV and follow the links.
Some code for "inspiration" may be found in Atmel's Examples for AT91, 
AVR, AVR32... from atmel.com. IRC I have also seen code to read 
WAV-Files in at least one of the examples. There is also a "WAV to 
ADPCM" converter (for PC, with source-code) in the Atmel 
Application-Notes for AVR. In example-codes from Sharp for ARM-based 
controllers there have also been WAV-decoding functions (search nxp.com, 
they acquired this business-section from Sharp). Check Microchip's 
AppNotes, ST Microelectronics STM32, STR7, STR9 AppNotes...

Author: Gerhard (Guest)
Posted on:

Rate this post
0 useful
not useful
you might look at SoX (Sound Exchange Program) at 
http://sox.sourceforge.net/. There is also a Windows executable. You can 
use it to create the pure binary data from a Wav file.

Gerhard

Author: Mirko Horstmann (m1rk0)
Posted on:

Rate this post
0 useful
not useful
Or, if you are looking for a programming library, libsndfile can import 
quite a lot of audio formats: http://www.mega-nerd.com/libsndfile/

Mirko

Author: Drachenbändiger (Guest)
Posted on:

Rate this post
0 useful
not useful
Your question is not really specific enough to permit a clear answer. 
Let me guess: Is this what you are after? wav2c: 
http://en.pudn.com/downloads105/sourcecode/speech/...

Author: Drachenbändiger (Guest)
Posted on:

Rate this post
0 useful
not useful
Here is another link (no login required) for wav2c :
  http://github.com/olleolleolle/wav2c

Author: Samuel_Schmid (Guest)
Posted on:

Rate this post
0 useful
not useful
Thank you very much for your answers.

I think the way2c is the right thing for me. But it seems like I have to 
compile this program first, before I can use it. Does anybody know how I 
have to do that?

Samuel_Schmid

Author: Drachenbändiger (Guest)
Posted on:

Rate this post
0 useful
not useful
Here is a precompiled version: http://darkfader.net/ngpc/files/wav2c.zip

Author: Samuel_Schmid (Guest)
Posted on:

Rate this post
0 useful
not useful
Thank you very much Drachenbändiger. It works.

I'm going to try the binary data as soon as posiible. I hope it sounds 
well.

Is it right that I have to do the 2-Complement with the generated data 
from the binary file or do I have to do that only in a 16-Bit Wav-File?

Thanks

Samuel_Schmid

Author: Drachenbändiger (Guest)
Posted on:

Rate this post
0 useful
not useful
You can feed the data directly into a D/A converter (for 8 bit data, I 
use a simple R2R network). Remove the DC component with a capacitor 
before you amplify the sound.

Author: rohit (Guest)
Posted on:
Attached files:

Rate this post
0 useful
not useful
give me the binary code

Author: A.txt (Guest)
Posted on:
Attached files:
  • a.wav (18.1 KB, 149 downloads)

Rate this post
0 useful
not useful
Please, give me a Binary-Data from Wav-File

Author: ASHISH Dev (Company: POLARIS) (ashish_dev)
Posted on:

Rate this post
0 useful
not useful
Hlo sir
Currently i m working on a project ""converting the sign language into 
speech"" therefore i m facing problem to convert "" .wav files into .hex 
file(byte format)"" to store them into micro controller, thn proceeding 
frm external speaker.
so ny1 plz suggest
thank you.

Author: Lothar Miller (lkmiller) (Moderator)
Posted on:

Rate this post
0 useful
not useful
ASHISH D. wrote:
> to store them into micro controller
Why not storing them on a µSD/SD card with a FAT file system? Then you 
could very easy change the sound data with a simple copy on any PC...

: Edited by Moderator
Author: Digpal (Guest)
Posted on:
Attached files:

Rate this post
0 useful
not useful
Hello

Author: adas sdasas (Guest)
Posted on:
Attached files:

Rate this post
0 useful
not useful
text

Author: kiran (Guest)
Posted on:
Attached files:

Rate this post
0 useful
not useful
Get Binary-Data from Wav-File

Author: asdasdsad (Guest)
Posted on:
Attached files:

Rate this post
0 useful
not useful
asd

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.