load a .wav file and display contents ?

Can someone give me a hand loading a wav file and displaying it’s contents?

The file is about 344KB

I’m using io.open(path, “rb” )

What do I need to change this to to show the hex values ?

if file then – nil if no file found
local contents = file:read( “*a” )
print( "Contents of " … path … “\n” … contents )
io.close( file )
end

[import]uid: 97524 topic_id: 18769 reply_id: 318769[/import]

you will need to read byte by byte and convert to hex equivalent

c [import]uid: 24 topic_id: 18769 reply_id: 72236[/import]

Thanks Carlos, will do! [import]uid: 97524 topic_id: 18769 reply_id: 72246[/import]

Carlos, on a similar note, cam I capture a wav to ram (instead of a file) and then output it’s contents?

[import]uid: 97524 topic_id: 18769 reply_id: 72248[/import]

not to ram.

c [import]uid: 24 topic_id: 18769 reply_id: 72251[/import]

are Corona working on an audio capture component based on OpenAL (tuner, capture, etc…) ?

I notice there’s already an audio read components based on it. [import]uid: 97524 topic_id: 18769 reply_id: 72253[/import]

I plan on writing an app that does sound capture into RAW as both Android and iOS can handle it.

Can you elaborate on the spec for RAW ?

signed or unsigned ?
little endian or big endian ?

Incidentally, I’ve got the file to load byte by byte - it’s instantaneous on the Mac simulator - takes 20 secs or more on the Windows Simulator?!?
[import]uid: 97524 topic_id: 18769 reply_id: 72256[/import]

Edit: Right, there’s actually the possibility to save a file that you read afterwards.

I would google for format descs. [import]uid: 58849 topic_id: 18769 reply_id: 72277[/import]