johnboiles / coremediaio-dal-minimal-example

Intended to be the most minimalistic example of a macOS CoreMediaIO DAL plugin.
MIT License
213 stars 31 forks source link

Fix Stream.mm to record in QT Player (#11) #13

Closed mizt closed 4 years ago

mizt commented 4 years ago

https://github.com/johnboiles/coremediaio-dal-minimal-example/pull/11

mizt commented 4 years ago

The version that calculates frames by sequence number has a problem with audio input in QT Player. At least this PR is working fine. And recording also succeeds.

QuartzCore.framework is required for CACurrentMediaTime().

johnboiles commented 4 years ago

So you're saying recording with audio wasn't working before your patch? What was happening? Was the audio not being included in the recording? Or was it not playing back correctly?

I could imagine this being possible if the presentationTimeStamp needs to line up with the timestamp of captured audio.

mizt commented 4 years ago

When using a built-in microphone (I'm singing).

327cfb58fc160ae063199796f142c215ffb5a264 https://github.com/johnboiles/coremediaio-dal-minimal-example/tree/327cfb58fc160ae063199796f142c215ffb5a264 Looks good (But the recording fails).

23994ef7fc93e7e29a6c9d53b72020bd27954f38 https://github.com/johnboiles/coremediaio-dal-minimal-example/tree/23994ef7fc93e7e29a6c9d53b72020bd27954f38 Sound is not valid. The animation will stop.

It works the same on both MacBook Air (Mojave) and MacBook Pro (Catalina).