armory3d / armory

3D Engine with Blender Integration
https://armory3d.org
zlib License
3.05k stars 317 forks source link

Error when using sound and compiles for Browser. #1829

Open Dzynek opened 4 years ago

Dzynek commented 4 years ago

Thank you for contributing to Armory!

Description Error when using sound and compiles for Browser.

Browser error: localhost/:11 GET http://localhost:8040/build_TestSound2/debug/html5/kha.js net::ERR_ABORTED 404 (File not found)

Blender console error: (node:3468) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, stat ...\TestSound2\build_TestSound2\debug\html5\hit0.ogg'

Does not export * .ogg sound, when manually copying this file it works.

When it compile for Krom, it works too.

To Reproduce Create a new project, add Speaker - add sound, Play Sound in Logic and compile for Browser

Expected behavior Nice if it worked the same as for Krom :)

Apple does not support .ogg audio files (IOS audio does not work in the browser) please add the option to change from .ogg to * .mp3

In the browser on Android, no sound can be heard when I use Logic -> Play Sound Node, it only works in Logic -> Play Speaker (with the "Stream" option on the speaker enabled).

It is possible to set the sounds volume in Logic?

System Blender: 2.82a Armory: 2020.09.0 OS: Windows 10 64 Graphics card: Radeon R9 200

Test File TestSound2.zip

(drag & drop the zipped .blend file here)

knowledgenude commented 4 years ago

Try to increase sound quality to 100%, i think this will avoid the sound compression to .ogg but i don't had tested it yet

screenshot1

Dzynek commented 4 years ago

Try to increase sound quality to 100%, i think this will avoid the sound compression to .ogg but i don't had tested it yet

The same error did not help :(

(node:10644) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, stat 'E:\Armory\Projekty\2.82a\TestSound2\build_TestSound2\debug\html5\hit0.ogg'

knowledgenude commented 4 years ago

@Dzynek it is saying that .ogg file was not found, because you have to use .wav sounds (that will be compressed as .ogg). Is the .mp3 file working in Kromx when you hit play?

I think Armory only accept .wav sounds. Even if you put a .ogg sound it will not work. You can convert this .mp3 into .wav and increase the sound quality to 1.00 and maybe it will work. Unfortunately i can't test it now.

See the last comments here: https://github.com/armory3d/armory/issues/1686

Dzynek commented 4 years ago

@Dzynek it is saying that .ogg file was not found, because you have to use .wav sounds (that will be compressed as .ogg). Is the .mp3 file working in Kromx when you hit play?

image

When use MP3 (with Different Sound Quality) in Krom - Unknown error

I have to remove MP3 from Outliner -> Blender File to avoid this error.

In Krom (use Wav) with Sound Quality 100% - there is no ogg, only wav.

image

But the browser still has the same error that there is no ogg

(node:10136) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, stat 'E:\Armory\Projekty\2.82a\TestSound2\build_TestSound2\debug\html5\hit0.ogg' I noticed that it probably does not compile (because it normally takes several seconds), it immediately runs a blank page in the browser

knowledgenude commented 4 years ago

It will need a fix to search for .ogg and .wav (or more supported audio files). But i think html support .ogg files, do you already tryed .wav compressed instead of .mp3?

Dzynek commented 4 years ago

image

I remember that in the earlier Armory3D and in the example "... \ armory_examples-master \ sound \" I changed the sound from Wav to MP3 and used in Logic -> Play Speaker Node (I marked Stream in the speaker) the sound in the browser on IOS and Android worked.

I read on the internet that Apple does not support OGG sound files.

knowledgenude commented 4 years ago

Maybe the Stream checkbox in your screenshot is the one mentioned by Robert here: https://github.com/Kode/Kha/pull/1194

Is it no more in the current version of Armory? Maybe it was moved to another place in the UI

Dzynek commented 4 years ago

Same error after disabling Stream checkbox

(node:756) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, stat 'E:\Armory\Examples\armory_examples-master\sound\build_sound\debug\html5\hit0.ogg'
(node:756) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:756) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Dzynek commented 4 years ago

...But i think html support .ogg files, do you already tryed .wav compressed instead of .mp3?

Yes