Can you run a Speaker from a Virtual Machine in TrueNAS?

I have in mind that I want to run a Docker Contained Application that I would like to be able to run in a Virtual Machine in TrueNAS and that application will play a sound through a speaker that is connected by some method to the TrueNAS box.

Is this even possible? Anyone ever tried, have any thoughts on where to start?

On a side note, I would like the application to be triggered, by a specific noise - so in / out audio would be great.

There are other ways to do this, of course, but I wanted to see if this was possible.

1 Like

On TrueNAS SCALE I know you can do PCI and USB device passthrough. What option you’d chose would depend on the type of soundcard you’re using. If you’re using more of a server motherboard you may need to purchase a USB DAC. They’re a dime a dozen these days.

1 Like

So OP could buy a USB DAC/sound card, a long USB cable, a speaker, a mic, and then have a bird/cat scared ready to defend their yard?

Neat!

(I have no idea if OP was actually going full home security or whatevs…just messing about)

No you pretty much nailed it.

I already have too many DACs to shake a stick at due to being a musician and being reluctant to throw anything away …ever…

I will give that a shout, not sure about the mic set up right now, I think a simple self-hosted python application to fire a pre-recorded sound burst for a minute or two whenever I hear the birds will be sufficient.

Thanks for the tips all.

1 Like

If you do find a script that listens / plays a clip, let us know?
(not at all urgent / important, but always fun to see projects develop)

The hardware passthrough is relatively simple, the other bits is unknown territory.
Maybe there is some “home automation” project that does something useful?

oh no, now I'm starting to rabbit-hole. Must Resist

Identify Bird Sounds With BirdNET-Pi on Raspberry Pi
GitHub - mcguirepr89/BirdNET-Pi: A realtime acoustic bird classification system for the Raspberry Pi 4B, 3B+, and 0W2 built on the TFLite version of BirdNET.

1 Like

Interesting, this is not available on Core - sorry only just go around to actually looking at this.

If I do get to it, likely either a C# web app or a Python script and I will post up here - unfortunately (or fortunately depending on how you look at it) - I just got pulled into a ChatGPT project at work - and it is a going to be a lot of work for a bit.