Open itlancer opened 5 months ago
Found workaround.
After video playback change volume to mute (via soundTransform
), wait ~30 frames (via ENTER_FRAME
) and only after call NetStream::dispose()
.
But for iOS it doesn't work. Seems this issue https://github.com/airsdk/Adobe-Runtime-Support/issues/15#issuecomment-2249029466
Problem Description
NetStream
stop viaNetStream::close()
orNetStream::dispose()
cause sound crackling. May be under hood AIR should send some extra data atNetStream::close()
orNetStream::dispose()
to audio decoder to prevent such behavior.Reproduced with multiple AIR versions, even with latest AIR 51.0.1.1 with multiple different platforms (Windows, macOS, Android, iOS) with different devices, applications and videos. Same issue in all cases. But with some audio devices (or audio drivers) and some videos/sound it not noticeable. There is no such issue using many other (non-AIR) video/audio applications, especially wich uses ffmpeg. Setting
SoundTransform::volume
to0
just beforeNetStream::close()
orNetStream::dispose()
didn't help. Playing withNetStreamAppendBytesAction.END_SEQUENCE
just beforeNetStream::close()
orNetStream::dispose()
didn't help. Didn't test with FLV videos. Didn't test withSound
.Related issues: https://github.com/airsdk/Adobe-Runtime-Support/issues/1939 https://github.com/airsdk/Adobe-Runtime-Support/issues/224 https://github.com/airsdk/Adobe-Runtime-Support/issues/211 https://github.com/airsdk/Adobe-Runtime-Support/issues/202 https://github.com/airsdk/Adobe-Runtime-Support/issues/155 https://github.com/airsdk/Adobe-Runtime-Support/issues/15
Steps to Reproduce
Launch application with code below. It just play video with audio in a loop. Click anywhere on stage to restart video (it will be stopped and new one started). You need to click in a "correct" moment to hear crackling noticeable and clear. Please take a look at demonstration video below.
Application example with sources and video sample attached. netstream_stop_crackling_bug.zip
Actual Result: Audio crackling at video restart (
NetStream::close()
orNetStream::dispose()
call). Video demonstration:https://github.com/airsdk/Adobe-Runtime-Support/assets/10899066/342a0636-a2b2-48ca-82f5-a55544d32998
Expected Result: No audio crackling at video restart (or stop).
Known Workarounds
1) After video playback change volume to mute (via
soundTransform
), wait ~30 frames (viaENTER_FRAME
) and only after callNetStream::dispose()
. 2) Write your own native extension to play video.