MATLAB Answers

I Made

Read wav file in hexa

Asked by I Made
on 28 Feb 2013

I want to read wav file in hexa, how i'm supposed to do that?

rawsignal=wavread('tes.wav','native');

above code returns me sample data in int16, can i convert it to hexa ? or even it's possible?

  0 Comments

Products

No products are associated with this question.

1 Answer

Answer by per isakson
on 28 Feb 2013
 Accepted answer

Try something:

    >> dec2hex(int8([126:127]),2)
    ans =
    7E
    7F

and

    >> dec2hex(int16([32765:32767]),4)
    ans =
    7FFD
    7FFE
    7FFF

  8 Comments

I Made
on 28 Feb 2013

Oh i'm really sorry i remove the 'native' code in

     y=wavread('tes.wav','native');

My bad, sorry it's the same < 250608 x int16 > to < 250608 x 4char >

But it cannot display it, it's say : Cannot display summaries of variables with more than 524288 elements.

Walter Roberson
on 28 Feb 2013

I'm not sure what kind of summary you expect for characters anyhow?

The summary in the workspace browser is just a convenience and has no effect on the program.

I Made
on 1 Mar 2013

Nothing important, i just wanna see it and solve the problem if anyhow i meet this kinda problem again. Anyway i've found how to do it, well we only need to write it down on excel. And very thank to both of you, you guys are great :D


Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply today