radio/libjs/wController/file/audio.js
2019-02-01 22:32:51 +00:00

25 lines
638 B
JavaScript

"use strict";
var File = require("./file");
var Vocabulary = require("../../wType/vocabulary");
var Vector = require("../../wType/vector");
var Uint64 = require("../../wType/uint64");
var Audio = File.inherit({
className: "Audio",
constructor: function Audio(addr) {
File.fn.constructor.call(this, addr);
},
hasMore: function() {
return this.getSize() > this.data.length();
},
getBitrate: function() {
return this._additional.at("bitrate").valueOf();
},
getDuration: function() {
return this._additional.at("duration").valueOf() / 1000;
}
});
module.exports = Audio;