Im developing extension by using Add-ons SDK extensions.
If I run it by “jpm run --debug”, it works well.
But if I make XPI by “jpm xpi”, install and run it, it doesn’t work.
Error msgs are,
-The buffer passed to decodeAudioData contains an unknown content type.
-EncodingError: The given encoding is not supported.
My extension speak current time using Google Translates.
var request = new XMLHttpRequest();
request.open('GET', FF.GOOGLE_TTS, true);
request.responseType = 'arraybuffer';
request.onload = function() {
var audioData = request.response;
try {
context.decodeAudioData(audioData, function(buffer) {
log('resolve');
resolve(buffer);
}, function(e) {
log('reject:', e);
reject(e);
});
}
catch(e) {
log('error', e);
reject(e);
}
};
request.send();
From the msg, I think decodeAudioData(audioData, … is the source of error.
My extension speaks well if I run it in “jpm run --debug”, but why does not it work when creating XPI, install, and run?
Any idea?
Thanks for reading.