Skip to content

Commit

Permalink
Fix issue #13 - read UTF8 chars in cue points
Browse files Browse the repository at this point in the history
  • Loading branch information
rochars committed Jul 25, 2019
1 parent 258ccfc commit 423c1d6
Show file tree
Hide file tree
Showing 16 changed files with 370 additions and 95 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# CHANGELOG

## version 8.4.5 (unreleased)
- Fix: read UTF8 chars in cue points (https://github.com/rochars/wavefile/issues/13)

## version 8.4.4 (2018-08-09)
- Fix: browser directive in package.json

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2017-2018 Rafael da Silva Rocha.
Copyright (c) 2017-2019 Rafael da Silva Rocha.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ https://google.github.io/styleguide/jsguide.html
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frochars%2Fwavefile.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frochars%2Fwavefile?ref=badge_large)

### LICENSE
Copyright (c) 2017-2018 Rafael da Silva Rocha.
Copyright (c) 2017-2019 Rafael da Silva Rocha.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
8 changes: 3 additions & 5 deletions dist/wavefile.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1919,7 +1919,7 @@ function unpack$1(buffer, theType, index=0) {
}

/*
* Copyright (c) 2017-2018 Rafael da Silva Rocha.
* Copyright (c) 2017-2019 Rafael da Silva Rocha.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
Expand Down Expand Up @@ -4090,20 +4090,18 @@ class WaveFile {
/**
* Read bytes as a ZSTR string.
* @param {!Uint8Array} bytes The bytes.
* @param {number} index the index to start reading.
* @return {string} The string.
* @private
*/
readZSTR_(bytes, index=0) {
/** @type {string} */
let str = '';
for (let i = index; i < bytes.length; i++) {
this.head_++;
if (bytes[i] === 0) {
break;
}
str += unpackString(bytes, i, i + 1);
}
return str;
return unpackString(bytes, index, this.head_ - 1);
}

/**
Expand Down
8 changes: 3 additions & 5 deletions dist/wavefile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1917,7 +1917,7 @@ function unpack$1(buffer, theType, index=0) {
}

/*
* Copyright (c) 2017-2018 Rafael da Silva Rocha.
* Copyright (c) 2017-2019 Rafael da Silva Rocha.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
Expand Down Expand Up @@ -4088,20 +4088,18 @@ class WaveFile {
/**
* Read bytes as a ZSTR string.
* @param {!Uint8Array} bytes The bytes.
* @param {number} index the index to start reading.
* @return {string} The string.
* @private
*/
readZSTR_(bytes, index=0) {
/** @type {string} */
let str = '';
for (let i = index; i < bytes.length; i++) {
this.head_++;
if (bytes[i] === 0) {
break;
}
str += unpackString(bytes, i, i + 1);
}
return str;
return unpackString(bytes, index, this.head_ - 1);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion dist/wavefile.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/wavefile.umd.js

Large diffs are not rendered by default.

Loading

0 comments on commit 423c1d6

Please sign in to comment.