Fixed disturbed audio for opus voice

canary
WolverinDEV 2018-11-04 15:41:50 +01:00
parent 18bfd8f7ec
commit 12860ef3ac
3 changed files with 6 additions and 2 deletions

View File

@ -72,6 +72,10 @@
flex-direction: row; flex-direction: row;
justify-content: stretch; justify-content: stretch;
&:not(:first-of-type) {
margin-top: 5px;
}
div { div {
flex-grow: 0; flex-grow: 0;

View File

@ -69,7 +69,7 @@ class CodecWrapper extends BasicCodec {
let audioBuf = this._audioContext.createBuffer(this.channelCount, array.length / this.channelCount, this._codecSampleRate); let audioBuf = this._audioContext.createBuffer(this.channelCount, array.length / this.channelCount, this._codecSampleRate);
for (let channel = 0; channel < this.channelCount; channel++) { for (let channel = 0; channel < this.channelCount; channel++) {
for (let offset = 0; offset < audioBuf.length; offset++) { for (let offset = 0; offset < audioBuf.length; offset++) {
audioBuf.getChannelData(channel)[offset] = array[channel + offset * 2]; audioBuf.getChannelData(channel)[offset] = array[channel + offset * this.channelCount];
} }
} }
resolve(audioBuf); resolve(audioBuf);

View File

@ -65,7 +65,7 @@ namespace sound {
node?: HTMLAudioElement; node?: HTMLAudioElement;
} }
let warned = false let warned = false;
let speech_mapping: {[key: string]:SpeechFile} = {}; let speech_mapping: {[key: string]:SpeechFile} = {};
function register_sound(key: string, file: string) { function register_sound(key: string, file: string) {