nguyenquyhy / Flight-Recorder

Record and replay flights in Microsoft Flight Simulator
https://flightsim.to/file/8163/flight-recorder
GNU General Public License v3.0
209 stars 22 forks source link

Record audio along with flight data #95

Open RoystonS opened 3 years ago

RoystonS commented 3 years ago

It would be really awesome if we could record audio along with the data track such that it automatically synchronises the audio at the right time during playback.

The use cases:

  1. We're currently looking at doing some synchronised/formation flying, and it would be amazing if I could record a demonstration of manoeuvres along with audio cues of when we're about to go into and come out of those manoeuvres. My partner could then bring my recording up as an AI plane and fly along in formation with them, and with my instructions. I can record a separate audio track and deliver it along with the Flight-Recorder file but synchronising up will be tricky, and will only really be doable at the start of the FR file.
  2. Tours. People could record entire flights with audio commentary along with them.
  3. Other training materials, such as VFR. "Turn right here at the Boeing building to a heading of 045..."
nguyenquyhy commented 3 years ago

That sounds like a great idea. Let me think how I can do that.

RoystonS commented 3 years ago

(I'm having a very quick play myself as a quick C# refresher: my C# skills used to be good but are 10 years out of date.)

Thinking aloud: streaming to a MemoryStream using NAudio looks relatively straightforward (totally ignoring all the details of selecting audio devices and so on!) and you've already done the hard work of creating a lovely zip file to contain your JSON, so adding a .wav/.ogg file in there isn't too bad. That'd work fine for short streams where you could afford to hold all the .wav data in memory, but for longer streams you'd probably want to compress on the fly rather than at save time, to reduce overall memory consumption.