I have a PIXI application that runs and works fine. I am new to PIXI – this project is my first, and I am doing it mostly to teach myself something new. I am trying to add sound to the project now, using the PIXI sound library. Adding just the import statement:
import { sound } from '@pixi/sound';
causes two things to happen.
-
I get FOUR warnings: “The AudioContext was not allowed to start”. I understand Chrome doesn’t want autoplay to happen, but I am not trying to play any sounds yet, just import the sound library, so I can load sound assets and be ready to play on events. This is not the end of the world, I can start the AudioContext after the first interaction, before I play any sounds, I am just curious why importing the library alone causes these warnings. (And why 4 of them)
-
I get a 500 error. There is no detail, no error message, no clue as to why this is happening, I just get a 500. Nothing in developer console gives me any clue as to why this is happening. (GET http://localhost:5173/ 500 (Internal Server Error)) This import line is the only change I have made, I am not yet doing anything with the sound library itself.
The import line is the second line in my file:
import * as PIXI from "pixi.js";
import { sound } from '@pixi/sound';
Is there something I am supposed to do before I can import sound? Am I missing something else?