Skip to content

MDN says FileReader.result is a String or ArrayBuffer, but Dartium says it's a Uint8List #17956

Closed
@sethladd

Description

@sethladd

MDN docs say FileReader.result is "A string or an ArrayBuffer which depends on the method used to initiate the read operation.": https://developer.mozilla.org/en-US/docs/Web/API/FileReader.result

The API docs say result is an object: https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart-dom-html.FileReader#id_result

In dartium, apparently FileReader.result is a Uint8List: (see screenshot)

Dart does not have a ArrayBuffer, but it does have a ByteBuffer.

decodeAudioData needs a ByteBuffer (previously, ArrayBuffer in JS world). See https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart-dom-web_audio.AudioContext#id_decodeAudioData

In JS code, I would get an ArrayBuffer from FileReader, and pass that decodeAudioData. Now, I get Uint8List from FileReader, so I need to convert.


Attachment:
[Screen Shot 2014-04-01 at 6.19.17 PM.png](https://storage.googleapis.com/google-code-attachments/dart/issue-17956/comment-0/Screen Shot 2014-04-01 at 6.19.17 PM.png) (208.11 KB)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.closed-obsoleteClosed as the reported issue is no longer relevantdocs-apilibrary-html

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions