I have a .wav file and i want to read this file binary how can i do this ?
And I have a feeling that you did not read the "how to use the forum-please read" stickies. #11 is a start. The information that you provided is not sufficient for us to be able to help you. Where is this file? Where do you want to display the file contents? Is this even an Arduino question?
Your are right sorry....
I have recorded a file in the .wav format. This file is stored to a SD Card. Now I want to transmit this file via bluetooth to my smarthpone. First I read this file I binary and send this binary code to my smartphone. But I do not know how to read a file stored on a SD card binary ?
The sd library reference is a good place to start. A Google search for "arduino read sd file" will yield more information.
But I do not know how to read a file stored on a SD card binary ?
All of the data stored on an SD card is in binary. It is the interpretation of the binary data that makes the difference.
Suppose that you read byte from a file on the SD card
The same byte might be interpreted as 65 in decimal, 41 in Hex, 'A' as a character, 01000001 in binary or even as 101 in octal
Summary : read a byte and interpret as you wish.
But if i write this:
myfile = SD.open("sample.wav");
Serial.write(myfile.read());
I just get "sample.wav"
BluPxl:
But if i write this:
myfile = SD.open("sample.wav");
Serial.write(myfile.read());
I just get "sample.wav"
Post your code, and prove that. Otherwise, you just look like a whiner. I'm sure that is not what you want.
File mafile
void setup() {
Serial.begin(19200);
sound_card.DeviceReset();
while (sound_card.DeviceReady()==0){}
}
void loop() {
byte Buffer[128];
myfile = SD.open("sample.wav", FILE_READ);
myfile.read(Buffer,128);
for(int i = 0 ;i<128;i++) {
Serial.write(Buffer[i]);
}
}
Because of how you posted it you clearly still didn't:
groundFungus:
And I have a feeling that you did not read the "how to use the forum-please read" stickies. #11 is a start.
Done...
File mafile
myfile = SD.open(
Ummm...
If you are going to use functions of the SD library, don't you think that you should #include it (and a begin in setup is missing). My advice is to load and run some of the examples included with the SD library to get more understanding of its use. Write a sketch that just reads a text file and displays the content in the serial monitor. It is a short step from there to writing the data out to the HC05.
I forget it to copy but i have it included. Uhhh and I replace mafile to myfile but still no difference. I get something like ⸮⸮⸮⸮⸮ and weired characters.
wav files contain non-printable data. So you will get odd results when you try to write it to serial monitor; it simply does not know what to do with them. Use a proper terminal program that can display received data in hex (e.g. realterm if you're using Windows).
Ok thank you !