how to convert .wav to .h (header file)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi,

   

I recently work on the psoc 3 and I would like to know how to convert .wav to .h

   

Is there some program that does that?

   

does someone have a music  file that is aleady converted?

   

 

   

please your advise

   

 

   

thanks

0 Likes
1 Solution
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Here is a project connected to PSOC 4, the principles are the same.

   

Its a simple serial interface.

   

 

   

    

   

          http://www.element14.com/community/docs/DOC-63798/l/project-50--sd-card-example-psoc-4-pioneer-kit-c...

   

 

   

Regards, Dana.

View solution in original post

0 Likes
14 Replies
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Google tells me bin2h exists: http://www.deadnode.org/sw/bin2h/

   

But the question: how do you want play it? Most likely the WAV file is larger than the flash memory in the PSoC3, so it won't fit there anyway...

HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

So probably want to use a SD card, and stream the data from there. Maybe the emfile component can help you there: http://www.cypress.com/?rID=58694

ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

A .h file in the embedded domain is generally consdiered to be a

   

file with text definitions in it for use by a compiler to generate code

   

for the UP to run.

   

 

   

A .wav file is an uncompressed digitized music or sound file.

   

 

   

So I do not understand what you are actually trying to do ? The

   

two files are totally unrelated.....

   

 

   

Regards, Dana.

Anonymous
Not applicable

 We store wave file in external SPI flash. Unless your audio is short time, don't think you can put in the flash,

Anonymous
Not applicable

thanks a lot!

   

I looket in the emFile example and it looks good for mre but

   

i still having issues regarding how to connect physically the SD to the CY8CKIT-001

   

where can i find an illustration?

   

 

   

BR

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Here is a project connected to PSOC 4, the principles are the same.

   

Its a simple serial interface.

   

 

   

    

   

          http://www.element14.com/community/docs/DOC-63798/l/project-50--sd-card-example-psoc-4-pioneer-kit-c...

   

 

   

Regards, Dana.

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Thanks on your answer

   

I work on this today and bought a sd connector (of te-company):

   

link: http://www.te.com/catalog/minf/en/610

   

and 2-gb sd card (of sandisk)

   

I work this afternoon on that and connect the sd card to wires (images attached)

   

I didn't figure our where are the three bottom pins (com, sd-wp, sd_cd)

   

What about the resistor is something internal or I need to put it.

   

What I understood from the em_file project is that I have connect just 4 pins.

   

Please help me out, even with a pictures

   

 

   

---------------------

   

What you do suggest in order to stream audio from the usb or from the sd card, I don't need more than 20 mb, but the speed is important.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

The SD_CD and SD_WP should be pulled up to Vdd, 5V, to enable

   

writes to SDCARD and invoke card detect. Normally in your code

   

the socket has a switch for card detect that tells your UP a card

   

is inserted. There can also be on the socket a switch user can

   

use to prevent writing to SDCARD. But for purposes of getting project

   

running also  just pull it up to Vdd.

   

 

   

Regards, Dana.

Anonymous
Not applicable

Dana,  Thanks for the fast reply

   

I Dont see any switch on the socket

   

the only thing I see is the switch on the card for lock

   

i see one 2 connections on the front of the socket(I Assume it should be The SD_CD and SD_WP but not sure

   

and another small pin on the top

   

I attached photos to demonstarte

   

thanks

   

P.S I understant that I should put the resistors in order to pull up?or is it internal resistors?

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Use external resistors for the time being.

   

 

   

Also, is your SDCARD 3.3 V or 5 V ? You need to configure

   

PSOC for the same voltage as the SDCARD, or set up Vddio

   

on PSOC to match the SDCARD Vdd.

   

 

   

The switches in some sockets are a feature, but not needed, and they

   

are for UP to detect if write prohibited or no card in socket. In your case

   

you do not care about either.

   

 

   

    

   

          http://alumni.cs.ucr.edu/~amitra/sdcard/Additional/sdcard_appnote_foust.pdf

   

 

   

Regards, Dana.

Anonymous
Not applicable

 Thank you on your fast reply

   

From what we understand this is will be better to work with USB and streaming the files?
thanks

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

If you are trying to playback stored music then you can either stream

   

it live from some tablet/pc/phone or from an SDCARD. So its not clear to

   

me what your design goals are, what are you tring to do....

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

Hi Dana,

   

My goal  is to stream a recorded file to the psoc then to filter it with the psoc and to get back the filtered file to then to hear the results with a speaker..

   

And i would like to know your suggest or even to see an example that I can use in order to stream the audio and the  to filter it and to hear ( i already tried usb_audio)

   

Thanks a lot

0 Likes
Anonymous
Not applicable

to connect the sd card to the cy8ckit I would rather buy one of the modules sold for arround $1 on ebay like:

   

 

   

http://www.ebay.com/itm/2PCS-SD-Card-Module-Slot-Socket-Reader-Read-And-Write-For-Arduino-ARM-MCU-/4...

   

http://www.ebay.com/itm/Micro-SD-card-Module-mini-TF-card-reader-SPI-interface-For-Arduino-/37122568...

   

http://www.ebay.com/itm/Mini-SD-Card-Module-Memory-Module-Micro-SD-Card-Module-for-Arduino-AVR-ARM-/...

   

 

   

at leat untill you have your project working and you can build your own board.

0 Likes