MCPcopy Create free account
hub / github.com/zhuker/lamejs / readProps

Method readProps

src/main/java/lowlevel/LameEncoder.java:486–521  ·  view source on GitHub ↗
(Map<String, Object> props)

Source from the content-addressed store, hash-verified

484
485 // properties
486 private void readProps(Map<String, Object> props) {
487 Object q = props.get(P_QUALITY);
488 if (q instanceof String) {
489 quality = string2quality(((String) q).toLowerCase(), quality);
490 } else if (q instanceof Integer) {
491 quality = (Integer) q;
492 } else if (q != null) {
493 throw new IllegalArgumentException(
494 "illegal type of quality property: " + q);
495 }
496 q = props.get(P_BITRATE);
497 if (q instanceof String) {
498 bitRate = Integer.parseInt((String) q);
499 } else if (q instanceof Integer) {
500 bitRate = (Integer) q;
501 } else if (q != null) {
502 throw new IllegalArgumentException(
503 "illegal type of bitrate property: " + q);
504 }
505 q = props.get(P_CHMODE);
506 if (q instanceof String) {
507 chMode = string2chmode(((String) q).toLowerCase(), chMode);
508 } else if (q != null) {
509 throw new IllegalArgumentException(
510 "illegal type of chmode property: " + q);
511 }
512 q = props.get(P_VBR);
513 if (q instanceof String) {
514 vbrMode = string2bool(((String) q));
515 } else if (q instanceof Boolean) {
516 vbrMode = (Boolean) q;
517 } else if (q != null) {
518 throw new IllegalArgumentException("illegal type of vbr property: "
519 + q);
520 }
521 }
522
523 /**
524 * Return the audioformat representing the encoded mp3 stream. The format

Callers 1

readParamsMethod · 0.95

Calls 3

string2qualityMethod · 0.95
string2chmodeMethod · 0.95
string2boolMethod · 0.95

Tested by

no test coverage detected