I need to convert an audio to binary in matlab. But, when i load the wave data it shows in the range [-1 1]. Because of the negative numbers i can't convert it to binary. When I tried it shows error. How can I get the binary of audio?
I'm not sure of what you want to do. WAV files generaly embeds signal as signed integers, the range depending on the nb of bits per samples (8bits -> samples between -128 and +127, 16 bits -> samples between -32768 and 32767...). MATLAB (as most of the tools that read wav files I'm aware of) handle this dynamic change by assigning each sample to a floating point value, and by fixing the dynamic between +1 and -1. To get your integer value back, you just need to multiplie your signal by the original dynamic (128 in 8bits, 32768 in 16bits...).
I can't see why negative values disturb you in an audio signal, maybe you're encoding your signal into unsigned 8 bits, but it does not mean that your signal is always > 0 ! In fact value from 0 to 127 are the negative ones, and from 128 until 255 it's the positive part. The comment above is still revelant, just take in account this offset.
"when I used "wavread" command to read an audio, the value in the variable shows negative. "
What's the problem with this ? An acoustic signal is a pressure change around a pressure mean, so there's positive and negative values. The simpliest signal is a sinus wave, it is a good example of values dancing around their mean (0)...