frgnca/AudioDeviceCmdlets

Write-AudioDevice should be able to adjust -[Timespan]SampleInterval and return floats

StartAutomating opened this issue · 3 comments

Cool set of cmdlets! I've been looking for something like this for quite some time.

Write-AudioDevice hard codes a sleep of 100 milliseconds between samples. This is good enough for many purposes, but not great for analyzing the currently playing audio, thus

  1. Write-AudioDevice should have a [Timespan]SampleInterval parameter, defaulting to 100 milliseconds.

Additionally, it looks like Write-AudioDevice is converting the float value into a 0-100 range. Again, this is fine for a lot of cases, but it looses a lot of precision. Thus:

  1. Write-AudioDevice -PlaybackStream should be able to return floats

It might be nice to be able to get the entire sample buffer as well.

I'm happy to take this particular work item on, as both parts of it should be fairly straightforward.

Hey James, Write-AudioDevice was something I threw together for a hackathon years ago and since then I've handed the project over to @frgnca. Out of curiosity, what are you looking to do that requires the additional precision?

@cdhunt @frgnca there are two major musical scenarios I'd like to put together with Write-AudioDevice:

  1. Integration with LightScript.

I've been building out a lot of smart lighting controlling code over the years. By being able to analyze playing audio in close to realtime, I should be able to make a music mode for lights that would work across multiple devices.

  1. Gameification.

Long story made short, with some details withheld, I'm looking at creating a new batch of games in PowerShell, and I want some of them to use synchronization with music to affect score (a la Rock Band / Guitar Hero / a million and one games since).

By the way, I haven't had any luck getting this code to build just yet. Does anyone have a .csproj for the repo?

Here's the sln and csproj from back in the day before @frgnca reorganized the project.