Message Boards Message Boards

0
|
8296 Views
|
3 Replies
|
2 Total Likes
View groups...
Share
Share this post:

What functions are available for Importing Sound files into M? *.WAV ?

Posted 9 years ago

Q1) I have been trying to import a sound.WAV file into M8 without success. I need to decipher the WAV header for # samples, sample rate, bits/sample, stereo y/n, ... I would greatly appreciate a code snipet that would accomplish this.

Q2) I can use Import["C:\dir1\dir2\sound.WAV","wave"] to load a complete file plus header.If the size of the file exceeds about 6MBytes, M8 "fails". Is there a real limit to the size of wave file that M8 can handle OR is this another mistake on my part?

POSTED BY: Gerald Kamin
3 Replies
POSTED BY: Jesse Friedman

This can be automated

fileName = "one.wav";
ele = Import[fileName, "Elements"]

Which gives, for this file

  {"AudioChannels", "AudioEncoding", "Data", "SampledSoundList", "SampleRate", "Sound"}

and now

 all = Import[fileName, #] & /@ ele;
POSTED BY: Nasser M. Abbasi

I was specifying that limited set of elements because the others are raw data from the audio of the file itself. If one wanted to fetch all available elements for a file, one could use

Import[fileName, #]&/@Import[fileName, "Elements"]

I'm pretty sure the set of available elements is the same for all wav files though.

POSTED BY: Jesse Friedman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract