rainbowcreatures / FlashyWrappers

AIR / Flash video recording SDK
17 stars 10 forks source link

Is there any way to control sound time/length ? #11

Closed rubel closed 7 years ago

rubel commented 7 years ago

Suppose I have a video of 20 second and I attach a sound of 30 seconds (addSoundtrack)..Then when we call myEncoder.finish();...and export the video...the video exports for 30 seconds instead of 20 seconds. Is there anyway to control it?

And also, suppose I have a video of 30 seconds and I attach a sound of 20 seconds in it...is there anyway to loop the sound until the video ends?

rubel commented 7 years ago

?

rainbowcreatures commented 7 years ago

Hey, thanks for your interested in FW - I'm sorry but I might have periods of time where I simply don't have the time to answer any questions in the issues. This is one of the main reasons I've made the whole project free and the source code available - lack of time to support it actively. You'll need to dive into the source and figure out stuff for yourself in case I don't answer.

What you're asking is implemented differently for different platforms. I don't remember the details, but I was trying to cut off "extra" sound on most platforms(might have not succeeded everywhere though). I know it should work on iOS for example. This is automatic.

As for the looping, I was never trying to achieve that, you'd have to implement this yourself.

rubel commented 7 years ago

addAudioFrame ?

rainbowcreatures commented 7 years ago

If you're looking for micromanaging adding the audio then addAudioFrame is a possibility. You need to have access to the raw PCM audio data to use it. This can be done in AS3 from any Sound by using .extract() (but beware, on mobile this causes lag with longer soundtrack).

In general managing audio was never a focus of FlashyWrappers though I understand the need of it, it was enough work to get the video recording (sort of) working. There's a separate project for recording audio with FW in realtime, you might use something of it, or might not:

https://github.com/rainbowcreatures/FWSoundMixer