1

How to convert an audio file into raw binary data in javascript?

6
  • No, I need to do it in javascript Commented Jul 16, 2011 at 6:58
  • 2
    Uh... what for? A bit of context would be good. What do you want to do with the raw binary data? Commented Jul 16, 2011 at 7:00
  • Is this from a web browser or using a local javascript interpreter like rhino? If it's from a web browser, you need to edit your question and say which one, since the mechanisms to allow local file access depend on the browser. Or if your web browser is running locally you should mention that too. Commented Jul 16, 2011 at 7:05
  • 1
    possible duplicate of Local file access with javascript Commented Jul 16, 2011 at 7:13
  • if you end up using Flash, there is stackoverflow.com/questions/1243912/read-local-file-in-flash Commented Jul 16, 2011 at 7:14

2 Answers 2

4

Use the File API.

With Blob data, you can get a Uint8Array or whatever other typed array you like. Here's a link to more info about Uint8Arrays.

You might also be interested in this.

Sign up to request clarification or add additional context in comments.

2 Comments

ooh, thank you! nice to know, I missed this while looking at new features
I've been messing with binary data lately in JavaScript. Just happened to know a few good resources.
0

You need to create handler that will do the job the javascript will only call the handler with the right parameters according to what you need look at jquery ajax call: http://api.jquery.com/jQuery.ajax/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.