How to Convert .wav file into binary?
Show older comments
load handel.mat
filename = 'handel.wav';
audiowrite(filename,y,Fs);
clear y Fs
[y,Fs] = audioread('handel.wav');
sound(y,Fs)
I want to use the following code to convert the .wav audio file into binary. Which MATLAB command should be used for converting .wav file in to binary?
TIA.
4 Comments
Jan
on 7 Mar 2018
What exactly is "binary" in your case?
Asra Khalid
on 7 Mar 2018
@Asra: Please try to explain the problem clearly. A binary stream of what? The signal or the contents of the file? If the data are stored in floating point format, do you want to convert the data to int8/16/32 at first or is is sufficient to interpret the binary representation of the IEEE754 doubles? Do you want a char vector or UINT8?
The less the readers have to guess, the easier and more likely matching is the answer.
[MOVED from section for answers]
I have to transmit sound file (.wav file) through LED's. For that I have to convert the .wav file in binary digits (0's & 1's) to turn LED's ON and OFF. I need the contents of the file to be converted into binary digits.
I hope it is more clear to you now.
[Please post comments in the section for comments]
Accepted Answer
More Answers (1)
Omar Longoria
on 12 Apr 2019
0 votes
Very good explanation. Thanks.
Categories
Find more on Audio and Video Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!