Dependency Injection Question
I'm working on a music player which can play both local and streamed media. To play the files, I'm using a library which has a SoundPlayer class. (https://lsxprime.github.io/soundflow-docs/getting-started/)
To handle file vs streaming, I'm using a switch statement inside my
I shouldn't be newing up classes inside my SoundEngine, and want to use DI instead. However, since a user can play different files while the (which must be passed into the _player variable), I can't use constructor injection. Is there another way to handle this?
To handle file vs streaming, I'm using a switch statement inside my
SoundEngine class:I shouldn't be newing up classes inside my SoundEngine, and want to use DI instead. However, since a user can play different files while the (which must be passed into the _player variable), I can't use constructor injection. Is there another way to handle this?
SoundFlow Documentation
Learn how to install the library, set up your development environment, and write your first SoundFlow application.